name: plan-mega-review
version: 2.0.0
description: |
The most thorough plan review possible. Three modes: SCOPE EXPANSION (dream big,
build the cathedral), HOLD SCOPE (review what's here with maximum rigor), and
SCOPE REDUCTION (strip to essentials). Context-dependent defaults, but when the
user says EXPANSION — go full send. Challenges premises, maps every failure mode,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
| sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| # https://docs.docker.com/compose/install/ |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Things I learned dealing with recursive JSON objects | |
| This is a summary of my findings while dealing with a django model, TaskCategory. | |
| ## Two ways for manipulating a set of trees | |
| I found two different ways for manipulating objects with an uncertain amount | |
| of ascendants / descendants. The first involves manipulating an object within | |
| a tree and the second involves taking apart the tree, manipulating the branches | |
| and building a new tree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Usage: heroku-pg-dump-schema.sh HEROKU-APP-NAME DB-ENV-VAR-NAME SCHEMA-NAME | |
| app=$1 | |
| env_var=$2 | |
| schema=$3 | |
| db_url=`heroku config -s --app ${app} | grep ${env_var}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // International Chemical Identifier Regex, by lo sauer - lsauer.com | |
| // Morphine InchI: | |
| var x="InChI=1S/C17H19NO3/c1-18-7-6-17-10-3-5-13(20)16(17)21-15-12(19)4-2-9(14(15)17)8-11(10)18/h2-5,10-11,13,16,19-20H,6-8H2,1H3/t10-,11+,13-,16-,17-/m0/s1" | |
| // applying an organic character-subset | |
| // we could check for the length property, but in case of 0 matches 'null' is returned -> hence !!.. \ generally equal to Boolean(..) | |
| !!x.trim().match(/^((InChI=)?[^J][0-9BCOHNSOPrIFla+\-\(\)\\\/,pqbtmsih]{6,})$/ig) | |
| >true | |
| //generic: | |
| x.trim().match(/^((InChI=)?[^J][0-9a-z+\-\(\)\\\/,]+)$/ig) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #INSERT INTO `core_url_rewrite` (`store_id`, `category_id`, `product_id`, `id_path`, `request_path`, `target_path`, `is_system`) | |
| SELECT 1 AS `store_id`, | |
| `sub`.`category_id`, | |
| `sub`.`entity_id` AS `product_id`, | |
| CONCAT('product', '/', `entity_id`, '/', `category_id`) AS `id_path`, | |
| `value` AS `request_path`, | |
| CONCAT('catalog/product/view/id/', `entity_id`, '/category/', `category_id`) AS `target_path`, | |
| 1 AS `is_system` | |
| FROM | |
| (SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <event.h> | |
| #include <evhttp.h> | |
| #include <pthread.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #include <fcntl.h> | |
| #include <sys/socket.h> | |
| #include <sys/types.h> | |
| #include <netinet/in.h> | |
| #include <iostream> |
NewerOlder