Skip to content

Instantly share code, notes, and snippets.

type APIWithExtra = {
hasExtra: true;
field: string;
optionalField: string;
}
type APINoExtra = {
hasExtra: false;
field: string;
}
from z3 import *
s = Optimize()
task_length = {
1: 20,
2: 50,
3: 80,
4: 50,
5: 60,
//////////////
// index.js //
//////////////
function flatten1(arr) {
// Imperative flatten that works by attaching elements to a resulting array
const res = [];
function inner(a) {
if(Array.isArray(a)) {
a.forEach(inner);
} else {
type MyADT = {
t: "Case1";
v1: string;
} | {
t: "Case2";
v2: string;
at: number;
} | {
t: "Case3",
v2: string
ssh -L 1433:mssql_server:1433 user@tunnel_through_server
@javcasas
javcasas / gist:37c7eaa141cc51f3907020d81ca082f6
Last active March 6, 2017 15:20
Bunch of good practices
* Prevent commiting to master with a pre-commit hook such as https://gist.github.com/eddywashere/107b33b35601d21b1a2a