Skip to content

Instantly share code, notes, and snippets.

@Randommood
Randommood / mongooplog
Created March 28, 2012 18:07 — forked from ajdavis/gist:1808903
mongooplog output
$ mongo --port 4000
MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:4000/test
PRIMARY> db.test.insert({'foo':'bar'})
PRIMARY> use local
PRIMARY> db.oplog.rs.find().sort({$natural:-1})
{ "ts" : { "t" : 1329058902000, "i" : 1 }, "h" : NumberLong("-9209932462579884476"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f37d45611558d5848a3d21a"), "foo" : "bar" } }
@Randommood
Randommood / pr.md
Created August 13, 2012 17:06 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Randommood
Randommood / 00-about.md
Created September 27, 2012 18:41 — forked from jasonrudolph/00-about.md
Rough Notes from Strange Loop 2012

About

This gist is a collection of my rough notes from Strange Loop 2012.

Follow me on Twitter to get updates as they're posted.

I'm posting these notes immediately after each talk. Expect typos, formatting glitches, incomplete thoughts, and ...

@Randommood
Randommood / haproxy.conf
Created October 5, 2012 22:37 — forked from gburd/haproxy.conf
Recommended haproxy settings to balance Riak protobuf and http interfaces (note: WORK IN PROGRESS)
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
@Randommood
Randommood / riak_graphite_stats.sh
Created December 10, 2012 19:03 — forked from benmmurphy/riak_graphite_stats.sh
riak -> graphite stats cron job
#!/bin/bash
# * * * * * root /path/to/riak_graphite_stats.sh
set -e
SOURCE=$(hostname)
GRAPHITE_PORT=2003
GRAPHITE_SERVER="myserver"
PREFIX="test.riak"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Randommood
Randommood / emacs_intro
Last active December 20, 2015 02:59 — forked from dimitri/gist:6031799
Emacs Tutorial
* An Emacs Workshop for Beginners
It's all about discovering Emacs Really
** Install
*** Emacs 24.3
http://emacsformacosx.com/
http://emacs.naquadah.org/
http://ftp.gnu.org/pub/gnu/emacs/windows/
** Conventions and docs
module SoftDelete
REQUIRED_PROPERTIES = [
[ :deleted_at, DataMapper::Property::DateTime ],
].freeze
def self.extended(klass)
REQUIRED_PROPERTIES.each do |property|
klass.send(:property, *property)
end
Bonnie Tyler - Total Eclipse of the Heart
Air Supply - Without You
Aerosmith - I Don't Want to Miss a Thing
No Doubt - Don't Speak
Toni Braxton - Un-Break My Heart
The Beatles - Hello Goodbye
Backstreet Boys - I want it that way
A whole new world
Whitney Houston - I Will Always Love You
Queen - The Show Must Go On
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)