Skip to content

Instantly share code, notes, and snippets.

View infusion's full-sized avatar

Robert Eisele infusion

View GitHub Profile
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
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
@infusion
infusion / fork-and-write-pid.sh
Created August 16, 2015 01:45
Fork a command and write the pid file on Bash
((/usr/local/php/bin/php -f /var/www/queue.php) & echo $! > /var/run/queue.pid &)
@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 / simulate-clicks.c
Last active June 21, 2016 11:22
Simulate clicks on OSX with C
// gcc -o click click.c -Wall -framework ApplicationServices
#include <ApplicationServices/ApplicationServices.h>
#include <unistd.h>
// Coord to click on
#define X 422
#define Y 192
int main() {