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
go: go.c | |
gcc -o go -O go.c -Wall -Wextra -std=c11 -ggdb |
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
#!/usr/bin/env python | |
import requests | |
import sys | |
rs = requests.Session() | |
if len(sys.argv) == 2: | |
filename = sys.argv[1] | |
f = open(filename, 'r') |
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
#!/usr/bin/env python3 | |
import wsgiref.simple_server | |
def app(environ, start_response): | |
start_response('200 OK', [('Content-type', 'text/plain')]) | |
return ['hello world'.encode('utf-8')] | |
def main(): | |
server = wsgiref.simple_server.make_server('0.0.0.0', 8000, app) |
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
#!/usr/bin/env python3 | |
import os | |
while True: | |
line = input('> ') | |
os.execvp(line, [line]) | |
# 0. run this code and try `ls` to make sure that much works | |
# 1. handle arguments (`ls /`) |
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
set nosmoothscroll | |
map <C-u> scrollPageUp | |
map <C-d> scrollPageDown | |
map t :tabnew!<Space> | |
map p ; | |
let blacklists = ["http://www.typingclub.com/*","http://www.keybr.com/*","http://en.lichess.org/*","http://vim-adventures.com/*","http://airbnb.io/*","https://coderpad.io/*","https://app.codesignal.com/*"] |
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
#!/usr/bin/env python3 | |
import html | |
import http.client | |
import re | |
from xml.etree import ElementTree | |
parser = ElementTree.XMLParser() | |
for entity, char in html.entities.html5.items(): | |
parser.entity[entity[:-1]] = char |
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
#!/usr/bin/env python3 | |
import time | |
import cron | |
def do_stuff1(): | |
print('stuff1!') | |
def do_stuff2(): | |
#1 / 0 |
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
#!/bin/sh | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
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
Examples of distributed (job) queues: | |
* http://python-rq.org/ | |
* https://github.com/twitter-archive/kestrel/wiki | |
* http://nsq.io/overview/quick_start.html | |
* http://gearman.org/ | |
* https://kafka.apache.org/documentation.html#quickstart | |
* http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html#application | |
and many more inferior queues: http://queues.io/ | |
So you want to write a distributed job queue? |
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
CFLAGS=-O2 -std=c11 -march=native -ggdb -pipe -Wall -Wextra -Wshadow | |
test: test.o | |
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ | |
clean: | |
rm -f *.o | |
rm -f test | |
.PHONY: clean |
OlderNewer