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
#include <unistd.h> | |
#include <stdio.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
size_t n_read; | |
void handle_alarm(int signum) { | |
printf("n_read = %lu\n", n_read); | |
fflush(NULL); |
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
# Running the script below will yield the following results: | |
# | |
# $ ipython log_memory_usage_example.py | |
# INFO:root:memory use before calling make_large_string : 19,340 kb | |
# INFO:root:memory use after calling make_large_string : 85,840 kb | |
# | |
import functools | |
import logging | |
import resource |
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
[ | |
{ | |
"title": "Amazon Launchpad for Startups", | |
"titlelink": "https://www.amazon.com/gp/launchpad", | |
"date": "September 01, 2016", | |
"hnlink": "http://news.ycombinator.com/item?id=12398823", | |
"addendums": [], | |
"context": [], | |
"text": "Amazon would like to sell your shitty kickstarter products. Hackernews cannot decide if they're concerned enough about this centralization of power to post on medium about how dangerous it is; doing so would take away from the time they need to write android apps and monitor their adsense income and check their gmail accounts to make sure they're not missing a hangout. One-third of them complain that the images on the program website are not huge enough. Others are disgruntled because someone may compete with them." | |
}, |
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
# always shfmt -i 2 this dealio | |
# i don't need to see my username | |
PS1='\h:\W \$ ' | |
# so i can recursive glob to find files e.g. echo src/**/App.java for a java src tree | |
# only works in bash 4.x and later, while mac still supplies crummy bash 3 | |
if shopt 2>&1 | grep -q globstar; then | |
shopt -s globstar | |
fi |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlueColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T | |
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPEB4wIDAuMDU4ODYw | |
MTk2MjYgMC42NzY4NjYwOTQ2IDFPEBEwIDAgMC42MTI5OTM2NTc2ABABgAKABtMUFQ0W |
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
[branch] | |
autosetupmerge = true | |
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch -a -vvv | |
brs = branch -a -vvv --sort committerdate | |
co = checkout | |
df = diff |
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
# this config is to facilitate one-way backups from fastmail to local maildir, | |
# it is specifically set to "Sync Pull" on the IMAP account to ensure | |
# read-only access. | |
# | |
# to run: | |
# | |
# brew install isync | |
# mbsync -a | |
BufferLimit 1024m |
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 do a one-shot backup: | |
# | |
# $ offlineimap -a fastmail | |
[general] | |
accounts = fastmail | |
ui = blinkenlights | |
[Account fastmail] |
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
" make sure to: | |
" mkdir -p ~/.config/nvim && echo 'source ~/.nvimrc' >> ~/.config/nvim/init.vim | |
" also install vim-plug: | |
" curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
" Then call :PlugInstall | |
call plug#begin() | |
Plug 'nnathan/desertrocks' | |
Plug 'fatih/vim-go', { 'tag': '*' } | |
" we really need to get rid of this - github.com/nnathan/desertrocks |
NewerOlder