Skip to content

Instantly share code, notes, and snippets.

Wade Simmons wadey

Block or report user

Report or block wadey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aaronjensen
aaronjensen / edit_data_bag.rb
Created Nov 21, 2012
Edit encrypted data bags for use with chef-solo and knife-solo
View edit_data_bag.rb
#!/usr/bin/env ruby
Dir.chdir File.join(__FILE__, "../..")
unless ENV['EDITOR']
puts "No EDITOR found. Try:"
puts "export EDITOR=vim"
exit 1
end
unless ARGV.count == 2
@pearkes
pearkes / gist:4069203
Created Nov 13, 2012
My shell prompt, with Vagrant and Git status.
View gist:4069203
# Example: http://s.jack.ly/iXhJ
prompt() {
PS1="${GREEN}\W\$(parse_git_branch) $BROWN\$(parse_vm_state) ${GREEN}${GREY}"
PS2="\[[33;1m\]continue \[[0m[1m\]> "
}
parse_git_branch() {
@srid
srid / subcommand.go
Created Oct 24, 2012
golang simple subcommand parser
View subcommand.go
// A simple sub command parser based on the flag package
package subcommand
import (
"flag"
"fmt"
"os"
)
type subCommand interface {
@holman
holman / cray.md
Created Oct 15, 2012
Dropbox is cray
View cray.md

Hi Zach,

We’re working to make it easier for your Dropbox for Teams administrators to manage all the stuff you and your teammates have in your Teams account. Soon, we’ll be releasing new features for admins to manage the security of your team’s stuff and make it easier for them to help when things go wrong.

In some cases, your admin may need the flexibility to take some actions on your Teams account, such as helping to manage shared folders or restoring access if you get locked out of your account. In order to clarify that admins may have access to team member accounts when managing the team, we're updating our Dropbox for Teams Agreement and Privacy Policy.

You might have some personal files in your Teams account that you’d like to move to a personal account. For example, if you want to keep vacation pictures in a different account from your latest Excel spreadsheet, you can use this online guide to move your files:

View the new agreement and get started here

@sjl
sjl / nextlast.vim
Created Sep 21, 2012
next/last text objects
View nextlast.vim
" Next and Last {{{
" Motion for "next/last object". "Last" here means "previous", not "final".
" Unfortunately the "p" motion was already taken for paragraphs.
"
" Next acts on the next object of the given type in the current line, last acts
" on the previous object of the given type in the current line.
"
" Currently only works for (, [, {, b, r, B, ', and ".
"
@iros
iros / API.md
Created Aug 22, 2012
Documenting your REST API
View API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.markdown

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
@eonnen
eonnen / gist:2647948
Created May 9, 2012
Sample ZK Configuration
View gist:2647948
# The number of milliseconds of each tick
tickTime=300
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/home/erik/var/data/zookeeper
View find_my_friends.js
var options, req, request;
request = require('request');
options = {
uri: 'https://p04-fmfmobile.icloud.com/fmipservice/friends/{account_id}/{unique_device_id}/minCallback/selFriend/refreshClient',
method: 'POST',
headers: {
'X-Apple-AuthScheme': 'Forever',
'Content-type': 'application/json'
View frame-protocol.js
/*
A simple new-line delimited JSON protocol with upgrades.
Receiving Usage:
protocol = require('./frame-protocol');
// parsing data
parser = protocol.Parser();
You can’t perform that action at this time.