Skip to content

Instantly share code, notes, and snippets.

View infusion's full-sized avatar

Robert Eisele infusion

View GitHub Profile
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin master --tags
git reset --soft "HEAD~1"
git push -f origin HEAD^:master
git push origin :v1.0.0
git tag -d v1.0.0
git branch -d branchname
git push origin :branchname
pandoc --mathjax --from markdown --to html5 -s file.md -o file.html
@infusion
infusion / copy-pubkey.sh
Last active August 29, 2015 14:27
Copy the pubkey to the clipboard
cat ~/.ssh/id_rsa.pub | pbcopy
git remote add upstream https://github.com/whoever/whatever.git
git fetch upstream
git checkout master
git rebase upstream/master
git push -f origin master
@infusion
infusion / url2pdf.sh
Created August 18, 2015 16:53
Download a website as PDF
#!/bin/bash
function url2pdf {
tmp_file=.tmp.html
res_file=${1//[^A-Za-z0-9.:-]/}.pdf
curl $1 > $tmp_file
cupsfilter -f $tmp_file > $res_file
rm $tmp_file
@infusion
infusion / js-min-api.sh
Last active February 3, 2016 12:49
Closure compiler API call
#!/bin/bash
# A simple helper file for Google Closure compiler
#
# Copyright (c) 2011, Robert Eisele (robert@xarg.org)
# Dual licensed under the MIT or GPL Version 2 licenses.
# Usage: ./generate.sh input.js output.js
curl --silent -d"compilation_level=ADVANCED_OPTIMIZATIONS&output_format=text&output_info=compiled_code" --data-urlencode "js_code@$1" \
@infusion
infusion / console-shapes.coffee
Last active February 5, 2016 18:26
Draw some shapes on the console using coffee script
###
# Draw some shapes on the console
# Copyright (c) 2014, Robert Eisele (robert@xarg.org)
# Dual licensed under the MIT or GPL Version 2 licenses.
###
draw = (size, cb) ->
chars = [ ":", "O" ]
i = 0