Skip to content

Instantly share code, notes, and snippets.

View skanev's full-sized avatar

Stefan Kanev skanev

View GitHub Profile
@mislav
mislav / git-promote.sh
Last active January 3, 2016 21:09
My branches + CI workflow. Requires hub for the `hub ci-status` command
#!/bin/sh
# Usage: git promote [<remote>[/<branch>]]
#
# Pushes the current branch to remote.
set -e
branch="$(git symbolic-ref --short HEAD)"
remote="${1%/*}"
remote_branch="${1#*/}"
@XVilka
XVilka / TrueColour.md
Last active September 19, 2024 04:17
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@Houl
Houl / expand-word.vim
Created January 7, 2014 18:26
expand("<cword>") for the word left from the cursor
func! ExpandHeadWord()
let [clnum, ccol] = searchpos('\<\k*\%(\k\@!.\)*\%#', 'bcWn')
if ccol >= 1
return matchstr(strpart(getline(clnum), ccol-1), '^\k*')
else
return ""
endif
endfunc
@AndrewRadev
AndrewRadev / latex.vim
Last active December 30, 2015 17:19
Tentative text object for latex math.
onoremap <buffer> a$ :<c-u>call <SID>LatexTextObject('a')<cr>
xnoremap <buffer> a$ :<c-u>call <SID>LatexTextObject('a')<cr>
onoremap <buffer> i$ :<c-u>call <SID>LatexTextObject('i')<cr>
xnoremap <buffer> i$ :<c-u>call <SID>LatexTextObject('i')<cr>
function! s:LatexTextObject(mode)
if a:mode == 'i'
call search('\$\{1,2}', 'Wbce')
call search('\S', 'W')
normal! my
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@davist11
davist11 / gist:1204569
Last active July 1, 2024 02:51
Campfire sounds
56k: "https://123.campfirenow.com/images/56k.gif"
bell: ":bell:"
bezos: ":laughing::thought_balloon:"
bueller: "anyone?"
butts: ":open_hands: :smoking:"
clowntown: "https://123.campfirenow.com/images/clowntown.gif"
cottoneyejoe: ":notes::hear_no_evil::notes:"
crickets: "hears crickets chirping"
dadgummit: "dad gummit!! :fishing_pole_and_fish:"
dangerzone: "https://123.campfirenow.com/images/dangerzone.png"