Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 15, 2025 05:11
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@theorm
theorm / fabfile.py
Created May 14, 2012 01:55
fabfile with tasks to deploy app on google appengine
from fabric.api import *
from fabric.colors import green, red
import os, sys
packages_dir = 'packages'
tmp_dir = 'tmp'
dependencies_filename = 'dependencies.zip'
def check_requirement(command,install_text):
failed = False
@lg0
lg0 / markdown.xml
Created April 10, 2012 19:58
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@zypsg
zypsg / uiunderlinebutton.h
Created March 27, 2012 09:52
iOS: Underline the title of a UIButton
@interface UIUnderlinedButton : UIButton
+ (UIUnderlinedButton*) underlinedButton;
@end
@huacnlee
huacnlee / imagemagick.rb
Created March 16, 2012 03:36
brew install imagemagick 6.7.1-1 for Lion 10.7.3 with RMagick
# some credit to https://github.com/maddox/magick-installer
require 'formula'
def ghostscript_srsly?
ARGV.include? '--with-ghostscript'
end
def ghostscript_fonts?
File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts"
end
@netmute
netmute / README.md
Last active May 10, 2025 11:03
Game of Life in 140 chars of Ruby

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

@kylefox
kylefox / color.m
Created January 27, 2012 17:45
Generate a random color (UIColor) in Objective-C
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@pablasso
pablasso / gist:1190578
Created September 3, 2011 04:45
Login script for Ubuntu: /etc/update-motd.d/00-stats
#!/bin/bash
echo " "
echo " ======================================="
echo " = Welcome to KENTAURUS. ="
echo " ======================================="
echo
btime=`who -b | sed -e 's/[^A-Z]*//'`
utime=`uptime | sed -e 's/ [0-9:]* up />/' -e 's/,.*//'`
echo " ==== BOOT TIME ==== ==== UPTIME ===="
echo " "$btime" " $utime