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
def main(): | |
print "main program" | |
if __name__ == "__main__": | |
main() |
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
$ ~/h/node/env-8.7.0/bin/node p.js | |
Error: wat | |
at c (/Users/kannan/dev/better-stack-traces/p.js:2:22) | |
at b.then (/Users/kannan/dev/better-stack-traces/p.js:5:30) | |
at <anonymous> | |
at process._tickCallback (internal/process/next_tick.js:188:7) | |
at Function.Module.runMain (module.js:667:11) | |
at startup (bootstrap_node.js:187:16) | |
at bootstrap_node.js:608:3 |
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
err Error: wat | |
at f (main.html:6) | |
at <anonymous> |
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
declare function pick<T,F extends keyof T> (obj: T, fields: F[]): Pick<T, F>; | |
type User = { | |
id: number, | |
email: string, | |
active: boolean, | |
}; | |
function ok(u: User) { | |
const a = pick(u, ['id', 'email']); |
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
### Keybase proof | |
I hereby claim: | |
* I am cakoose on github. | |
* I am cakoose (https://keybase.io/cakoose) on keybase. | |
* I have a public key ASBHvqOMNvwpfjoEEcKvPCaNgai270nk1U2UX9jHRLNk7wo | |
To claim this, I am signing this object: |
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
import java.util.IdentityHashMap; | |
public class HMap { | |
public static final class Key<T> {} | |
private IdentityHashMap<Key<?>, Object> inner = new IdentityHashMap<>(); | |
public <T> T get(Key<T> key) { | |
Object raw = inner.get(key); | |
@SuppressWarnings("unchecked") |
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
Last | First | Age | |
---|---|---|---|
Doo | Scooby | 12 | |
Macdonald | Norm | 50 |
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
/* | |
To compile: g++ -std=c++11 -Wall -o align_buffer align_buffer.cc | |
Examples: | |
$ ./align_buffer 0 64 | |
required alignment = 64 | |
start_int = 0 | |
adjusted_int = 0 | |
adjusted_len = 64 |
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
$ python --version | |
Python 3.8.0 | |
$ python -m pip install pycares | |
Collecting pycares | |
Using cached https://files.pythonhosted.org/packages/85/de/cd46a73e43e206a6ad1e9cf9cc893c3ed1b21caf57f1e0a8d9a119d290eb/pycares-3.0.0.tar.gz | |
Requirement already satisfied: cffi>=1.5.0 in /Users/kannan/.pyenv/versions/3.8.0/lib/python3.8/site-packages (from pycares) (1.13.1) | |
Requirement already satisfied: pycparser in /Users/kannan/.pyenv/versions/3.8.0/lib/python3.8/site-packages (from cffi>=1.5.0->pycares) (2.19) | |
Installing collected packages: pycares | |
Running setup.py install for pycares ... error | |
ERROR: Command errored out with exit status 1: |
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
setopt histignoredups | |
# Prompt | |
source "/usr/local/etc/bash_completion.d/git-prompt.sh" | |
GIT_PS1_SHOWDIRTYSTATE=1 | |
GIT_PS1_SHOWSTASHSTATE=1 | |
GIT_PS1_SHOWUNTRACKEDFILES=1 | |
precmd() { __git_ps1 $'\e[0;32m%n@%m\e[0m:\e[0;34m%~\e[0m' $'\n\$ ' ' [%s]' } |
OlderNewer