Skip to content

Instantly share code, notes, and snippets.

/* Generated by Nim Compiler v0.10.3 */
/* (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
gcc -c -w -O3 -fno-strict-aliasing -I/media/nim/lib -o /home/deen/nimcache/asd.o /home/deen/nimcache/asd.c */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <stdio.h>
@zzzeek
zzzeek / dictionary comprehensions?
Last active August 29, 2015 14:06
cPython - Which is Faster?
import timeit
def go1():
d = {}
for i in range(100):
d[i] = "hi %s" % i
return d
@kachayev
kachayev / concurrency-in-go.md
Last active May 4, 2025 05:48
Channels Are Not Enough or Why Pipelining Is Not That Easy
@asimihsan
asimihsan / tornadolog.py
Last active October 28, 2019 22:13
Tail a file over HTTP WebSockets with a Tornado server.
#!/usr/bin/env python
import logging
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.websocket
from tornado.options import define, options
from tornado.process import Subprocess
@jdewit
jdewit / vim74_lua
Last active January 30, 2024 04:57
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@xixixao
xixixao / -
Created March 10, 2014 14:37
I = [5, 6, 7]
matrix = [
[1, 10, -57, -9, -24, 0, 0, 0, 0]
[0, 0.5, -5.5, -2.5, 9, 1, 0, 0, 0]
[0, 0.5, -1.5, -0.5, 1, 0, 1, 0, 0]
[0, 1, 0, 0, 0, 0, 0, 1, 1]
]
max = (array) ->
@aearly
aearly / Gruntfile.js
Last active June 24, 2016 06:43
Annotated Browserify Gruntfile
/**
* Annotated Gruntfile.
* This builds a Backbone/Marionette application using Dust.js (Linkedin fork) as a
* templating system, as well as some helpers from Foundation, with Browserify.
* It also configures a watcher and static server with live reload.
*/
module.exports = function (grunt) {
// This automatically loads grunt tasks from node_modules
require("load-grunt-tasks")(grunt);
@prwhite
prwhite / Makefile
Last active June 5, 2025 06:52
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@jbenet
jbenet / simple-git-branching-model.md
Last active May 3, 2025 18:07
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.