If you can keep your head when all about you
Are losing theirs and blaming it on you,
If you can trust yourself when all men doubt you
But make allowance for their doubting too,
If you can wait and not be tired by waiting,
Or being lied about, don't deal in lies,
Or being hated, don't give way to hating,
And yet don't look too good, nor talk too wise:
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! IAmAPutsEmojiDebugger() | |
ruby <<EOS | |
separator = rand(0x1F601..0x1F64F).chr('UTF-8') | |
VIM::command("normal! oputs '#{separator}' * (`tput cols`.to_i / 2)") | |
VIM::command('normal! oputs "#{__FILE__}:#{__LINE__}"') | |
VIM::command("normal! oputs '#{separator}' * (`tput cols`.to_i / 2)") | |
EOS |
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
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
function! s:align() | |
let p = '^\s*|\s.*\s|\s*$' | |
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
Tabularize/|/l1 | |
normal! 0 | |
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
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:switch_custom_definitions = | |
\ [ | |
\ { | |
\ '\<\(\l\)\(\l\+\(\u\l\+\)\+\)\>': '\=toupper(submatch(1)) . submatch(2)', | |
\ '\<\(\u\l\+\)\(\u\l\+\)\+\>': "\\=tolower(substitute(submatch(0), '\\(\\l\\)\\(\\u\\)', '\\1_\\2', 'g'))", | |
\ '\<\(\l\+\)\(_\l\+\)\+\>': '\U\0', | |
\ '\<\(\u\+\)\(_\u\+\)\+\>': "\\=tolower(substitute(submatch(0), '_', '-', 'g'))", | |
\ '\<\(\l\+\)\(-\l\+\)\+\>': "\\=substitute(submatch(0), '-\\(\\l\\)', '\\u\\1', 'g')", | |
\ } | |
\ ] |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
/* `XHTML, HTML4, HTML5 Reset | |
----------------------------------------------------------------------------------------------------*/ | |
a, | |
abbr, | |
acronym, | |
address, | |
applet, | |
article, | |
aside, |
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
# Autocomplete from current tmux screen buffer | |
_tmux_pane_words() { | |
local expl | |
local -a w | |
if [[ -z "$TMUX_PANE" ]]; then | |
_message "not running inside tmux!" | |
return 1 | |
fi | |
w=( ${(u)=$(tmux capture-pane \; show-buffer \; delete-buffer)} ) | |
_wanted values expl 'words from current tmux pane' compadd -a w |
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 | |
# | |
# Git commit-msg hook. If your branch name is in the form "t123", automatically | |
# adds "Refs #123." to commit messages unless they mention "#123" already. | |
# Include "#close" or "#finish" to add "Closes #123." | |
# | |
# For Pivotal Tracker, branch names like "s123" adds "[#123]". | |
# Include "#close" or "#finish" to add "[Finishes #123]". | |
# | |
# If you include "#noref" in the commit message, nothing will be added to |
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
# A little toy file demonstrating how to build chainable | |
# data transformations that reveal some amount of intent | |
# through named extracted methods. | |
# | |
# Kudos to @mfeathers for giving me the idea to try this | |
# | |
# Copyright Test Double, LLC, 2016. All Rights Reserved. | |
require_relative "marketing_refinements" |
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
// jQuery checkbox utility plugin. | |
// Triggers "change" events on the checkboxes. | |
// By Henrik Nyh <http://henrik.nyh.se> 2009-04-27 under the MIT License. | |
(function($) { | |
function makeChecked($checkboxes, checked) { | |
return $checkboxes.prop("checked", checked).trigger("change"); | |
} |
NewerOlder