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 'gmail' | |
require 'github_api' | |
require 'netrc' | |
require 'pry' | |
netrc = Netrc.read | |
github = Github.new(basic_auth: netrc['api.github.com'].join(':')) | |
Gmail.new(*netrc['imap.gmail.com']) do |gmail| | |
gmail.inbox.emails(from: 'github.com').each do |message| | |
begin |
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
(def ^:private autocmds (dict)) | |
(defmacro augroup [name & body] | |
`(try | |
(execute "augroup" ~(str name)) | |
(execute "autocmd!") | |
~@body | |
(finally (execute "augroup END")))) | |
(defmacro autocmd [type pattern & body] | |
(let [sym (gensym "autocmd")] | |
`(do |
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
nmap <script> <SID>: :<C-R>=getcmdline() =~ ',' ? "\0250" : ""<CR> | |
nmap <script> d<CR> <SID>:Dispatch<CR> | |
nmap <script> d<Space> <SID>:Dispatch<Space> | |
nmap <script> d! <SID>:Dispatch! | |
nmap <script> <SID>make <SID>:<C-R>=exists(':Make') > 1 ? 'Make' : 'make'<CR> | |
nmap <script> m<CR> <SID>make<CR> | |
nmap <script> m<Space> <SID>make<Space> | |
nmap <script> m! <SID>make! | |
" Is there a better mnemonic than =? |
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
#!/usr/bin/env bash | |
# SSH to the user and host given by a Git remote and chdir to the repo path. | |
# The first argument is the remote name. All other arguments are passed to | |
# SSH, with some fudging to run a login shell if no command is given. | |
# Use git ssh -d to see the exact SSH command. | |
# Copyright (c) Tim Pope. Distributed under the MIT License. |
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
#!/usr/bin/env ruby | |
sql = 'look "quotes," a \backslash, and #{:interpolation}' | |
puts instance_eval(%("#{sql.gsub(/[\\"]/,'\\\\\\&')}")) |
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
Feature: test | |
Scenario: test | |
When I run the suite | |
Then the method should be callable |
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 Kernel | |
def blank_context(*args, &block) | |
ivars = args.extract_options! | |
args.push(/^__/) | |
klass = Class.new do | |
instance_methods.each do |m| | |
undef_method(m) unless args.any? { |pattern| m =~ pattern } | |
end |
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
hcd() { | |
cd "$HASHROCKET_DIR/$1" | |
} | |
if [ -n "$BASH_VERSION" ]; then | |
_hcd() | |
{ | |
local cur projects | |
[ -r "$HASHROCKET_DIR" ] || return 0 |
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
let g:ack = "ack -H" | |
function! s:ack(cmd,args) | |
let grepprg_bak = &grepprg | |
try | |
let &grepprg = g:ack | |
silent execute a:cmd . ' ' . a:args | |
finally | |
let &grepprg = grepprg_bak | |
endtry |
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
" hashrocket.vim | |
" vim:set ft=vim et tw=78 sw=2: | |
if $HASHROCKET_DIR == '' && expand('<sfile>') =~# '/ops/hashrocket\.vim$' | |
let $HASHROCKET_DIR = expand('<sfile>')[0 : -20] | |
endif | |
if $HASHROCKET_DIR == '' && filereadable(expand('~/.bashrc')) | |
let $HASHROCKET_DIR = expand(matchstr("\n".join(readfile(expand('~/.bashrc')),"\n")."\n",'\n\%(export\)\=\s*HASHROCKET_DIR="\=\zs.\{-\}\ze"\=\n')) | |
endif | |
if $HASHROCKET_DIR == '' |
OlderNewer