This file contains 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
type APIWithExtra = { | |
hasExtra: true; | |
field: string; | |
optionalField: string; | |
} | |
type APINoExtra = { | |
hasExtra: false; | |
field: string; | |
} |
This file contains 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
from z3 import * | |
s = Optimize() | |
task_length = { | |
1: 20, | |
2: 50, | |
3: 80, | |
4: 50, | |
5: 60, |
This file contains 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
////////////// | |
// 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 { |
This file contains 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
type MyADT = { | |
t: "Case1"; | |
v1: string; | |
} | { | |
t: "Case2"; | |
v2: string; | |
at: number; | |
} | { | |
t: "Case3", | |
v2: string |
This file contains 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
ssh -L 1433:mssql_server:1433 user@tunnel_through_server |
This file contains 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
* Prevent commiting to master with a pre-commit hook such as https://gist.github.com/eddywashere/107b33b35601d21b1a2a |