Skip to content

Instantly share code, notes, and snippets.

View abecode's full-sized avatar

Abe Kazemzadeh abecode

View GitHub Profile
@peterneubauer
peterneubauer / gist:2652082
Created May 10, 2012 09:19
Basic Graphviz
Transaction tx = neo.beginTx();
try
{
final Node emil = neo.createNode();
emil.setProperty( "name", "Emil Eifrém" );
emil.setProperty( "age", 30 );
final Node tobias = neo.createNode();
tobias.setProperty( "name", "Tobias \"thobe\" Ivarsson" );
tobias.setProperty( "age", 23 );
tobias.setProperty( "hours", new int[] { 10, 10, 4, 4, 0 } );
Our yachts are toy boats, the glint on a lovely brief bubble of time. A boat's importance as an escape from reality, as a change of pace, as a theme for reflection and as an art form gives it worth or value.
--William Garden
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
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
@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@drewkerrigan
drewkerrigan / setup.md
Last active July 12, 2018 14:31
simple Riak default schema search setup

Simple Search 2.0 Setup

Create an index
curl -i -XPUT http://localhost:8098/search/index/my_index
Link the index to a bucket
#!/bin/bash
# pdfScale.sh
#
# Scale PDF to specified percentage of original size.
# Ref: http://ma.juii.net/blog/scale-page-content-of-pdf-files.
echo "This script doesn't handle files with spaces in them."
SCALE=0.95 # scaling factor (0.95 = 95%, e.g.)
@josephspurrier
josephspurrier / values_pointers.go
Last active April 28, 2024 16:41
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@jarutis
jarutis / ubuntu.sh
Last active November 9, 2020 09:01
Theano and Keras setup on ubuntu with OpenCL on AMD card
## install Catalyst proprietary
sudo ntfsfix /dev/sda2
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.BAK
sudo apt-get remove --purge fglrx*
sudo apt-get install linux-headers-generic
sudo apt-get install fglrx xvba-va-driver libva-glx1 libva-egl1 vainfo
sudo amdconfig --initial
## install build essentials
sudo apt-get install cmake
@kpq
kpq / barley.tsv
Created September 30, 2015 21:14
Barley data: comparison circles
yield variety year site
27 Manchuria 1931 University Farm
48.86667 Manchuria 1931 Waseca
27.43334 Manchuria 1931 Morris
39.93333 Manchuria 1931 Crookston
32.96667 Manchuria 1931 Grand Rapids
28.96667 Manchuria 1931 Duluth
43.06666 Glabron 1931 University Farm
55.2 Glabron 1931 Waseca
28.76667 Glabron 1931 Morris
@gtallen1187
gtallen1187 / scar_tissue.md
Created November 1, 2015 23:53
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation