Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
As configured in my dotfiles.
start new:
tmux
start new with session name:
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 |
package object mail { | |
implicit def stringToSeq(single: String): Seq[String] = Seq(single) | |
implicit def liftToOption[T](t: T): Option[T] = Some(t) | |
sealed abstract class MailType | |
case object Plain extends MailType | |
case object Rich extends MailType | |
case object MultiPart extends MailType |
========================================== ========================================== | |
TMUX COMMAND WINDOW (TAB) | |
========================================== ========================================== | |
List tmux ls List ^b w | |
New new -s <session> Create ^b c | |
Attach att -t <session> Rename ^b , <name> | |
Rename rename-session -t <old> <new> Last ^b l (lower-L) | |
Kill kill-session -t <session> Close ^b & |
// simple example of the cake pattern | |
// abstract DAO trait | |
trait Repository[A, B]{ | |
// saves an entity, returns an ID | |
def save(entity: A): B | |
// more features.. | |
} | |
trait RdbmsRepository extends Repository[MyUserCaseClass, Long]{ |
#!/usr/bin/env bash | |
cat /var/log/apache2/access_log | awk '{print $1}' > ips.txt | |
uniq ips.txt > uniqips.txt | |
IPS=`cat uniqips.txt` | |
for i in $IPS | |
do | |
echo "$i,`geoiplookup $i | cut -d "," -f2 | sed -e 's/^[\t]//'`" >> ipinfo.csv | |
done |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
data: text/html, | |
<html> | |
<head> | |
<title>Notepad</title> | |
<link rel="icon" type="image/png" href="http://icons.iconarchive.com/icons/hopstarter/sleek-xp-software/256/Notepad-icon.png"> | |
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('#text').bind('keyup', function() { | |
var content = $(this).val(); |