This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! GolangCurrentPackage() | |
let packageLine = search("package", "s") | |
'' | |
let packageName = split(getline(packageLine), " ")[1] | |
return packageName | |
endfunction | |
function! GolangTestCurrentPackage() | |
call VimuxRunCommand("clear;go test " . GolangCurrentPackage()) | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ben@master↑1 S:1 M:2 ?:5 | |
User "ben" on branch "master" ahead by 1 commit with 1 staged change, 3 modified changes and 5 untracked files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
outa-here = !kill -9 `ps -p $PPID -o ppid=` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example | |
var GitGoggles = { | |
getRepositories: function (callback) { | |
this._get('repositories', callback); | |
}, | |
getRepository: function (repoName, callback) { | |
this._get('repository/'+repoName, callback); | |
}, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'factory_girl' | |
class Foo | |
attr_accessor :bar | |
end | |
FactoryGirl.define do | |
factory :foo do | |
bar [1,2,3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OperatorTable addAssignOperator(":", "atPut") | |
foo := method( | |
arg := call argAt(0) | |
map := Map clone | |
arg doInContext(map) | |
) | |
foo(key: "val") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can add tags to describe blocks | |
describe("Bar", tags("version": "0.5.0"), | |
it("has a foo", | |
Bar foo will == "foo" | |
) | |
) | |
describe("Foo", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(echo). | |
-export([go/0]). | |
go() -> | |
Pid2 = spawn(fun() -> loop() end), | |
Pid2 ! {self(), hello}, | |
receive | |
{Pid2, Msg} -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{exec} = require 'child_process' | |
execRuby = (code, callback) -> | |
escapedCode = code.replace(/\\n/g, "\\n").replace(/"/g, "\\\"") | |
exec "ruby -e \"#{escapedCode}\"", (err, stdout, stderr) -> | |
callback(err, stdout) | |
execJS = (code, callback) -> | |
escapedCode = code.replace(/\\n/g, "\\n").replace(/"/g, "\\\"") | |
exec "node -e \"#{escapedCode}\"", (err, stdout, stderr) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/braintree/braintree_client_side_encryption_examples/master/ajax/public/javascripts/braintree-1.1.0.min.js"></script> | |
<script type='text/javascript'> | |
// Set up Braintree Lib | |
var clientSideEncryptionKey = 'YOUR_KEY_HERE'; // You can find your key under My User > API Keys > View | |
var braintree = Braintree.create(clientSideEncryptionKey); |