This file contains hidden or 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
| sed = !git grep -l $1 | xargs sed -i "" -e "s/$1/$2/g" && echo > /dev/null |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) -> |