Skip to content

Instantly share code, notes, and snippets.

@minhajuddin
minhajuddin / README.md
Created December 21, 2011 03:29
Script to retrieve content from google cache
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@jboner
jboner / latency.txt
Last active June 16, 2024 08:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 15, 2024 23:32
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@deekayen
deekayen / 1-1000.txt
Last active May 17, 2024 00:39
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that
@gavinmh
gavinmh / ner.py
Last active December 5, 2018 18:59
Named Entity Extraction with NLTK in Python
# -*- coding: utf-8 -*-
'''
'''
from nltk import sent_tokenize, word_tokenize, pos_tag, ne_chunk
def extract_entities(text):
entities = []
for sentence in sent_tokenize(text):
publisher_id publisher_sis_id course_id course_sis_id section_id section_sis_id student_id student_sis_id enrollment_id enrollment_status score grade
393675 242844 ANP 1 430746 1248367 bobby 9951104 active 19.3 A-
393675 242844 ANP 1 430746 959580 kevin.demoadmin 11012806 active 0 A-
393675 242844 ANP 1 430746 959580 11012806 active 0 A-
393675 242844 ANP 1 313444 925342 samhansen1 6883559 active 37.4 A-
393675 242844 ANP 1 313444 1310040 9053263 invited 11.8 A-
@kristopherjohnson
kristopherjohnson / formatjson.js
Last active May 14, 2024 23:13
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();