Skip to content

Instantly share code, notes, and snippets.

Christoph Kirsch ckirsch

View GitHub Profile
@ckirsch
ckirsch / pr.md
Created Sep 10, 2016 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

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:

@ckirsch
ckirsch / Build Script for Cross Compilers (xgcc)
Created Aug 19, 2013
This is a script for building gcc cross compilers.
View Build Script for Cross Compilers (xgcc)
# Building xgcc for C:
# On a mac install the latest gcc binaries via macports.org:
sudo port install gcc48
port select --list gcc
sudo port select --set gcc mp-gcc48
hash -r
# Building xgcc:
@ckirsch
ckirsch / C Makefile for Shared Libraries
Last active Dec 20, 2015
This is a makefile for compiling C programs that implement shared libraries. It also serves as example for compiling regular C programs.
View C Makefile for Shared Libraries
# This is for C but can easily be modified to work for other languages as well
CC = gcc
# Object files go into $(OBJDIR), executables go into $DISTDIR
OBJDIR = build
DISTDIR = dist
# Uncomment next line to overwrite standard malloc library
# WRAP = -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=calloc -Wl,--wrap=realloc -Wl,--wrap=malloc_usable_size
@ckirsch
ckirsch / Reduce File Size Medium Quality 150dpi.qfilter
Created Aug 11, 2013
Putting this file into /Library/PDF Services/ on a Mac OS 10.8 system will provide a new option in the Preview app for exporting PDFs at reduced file size but with still acceptable quality.
View Reduce File Size Medium Quality 150dpi.qfilter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Domains</key>
<dict>
<key>Applications</key>
<true/>
<key>Printing</key>
<true/>
@ckirsch
ckirsch / .gitconfig
Created Mar 25, 2013
My .gitconfig file
View .gitconfig
[user]
name = Christoph Kirsch
email = ***
[core]
editor = subl -w
autocrlf = input
safecrlf = warn
[merge]
tool = vimdiff
[alias]
@ckirsch
ckirsch / gpgmulti
Last active Dec 14, 2015
Symmetrically encrypt multiple files with GnuPG
View gpgmulti
#!/bin/bash
###############################################################################
## name : gpgmulti.sh (original by Nick Montpetit)
## purpose : symmetrically encrypts/decrypts multiple files using GnuPG
## usage : gpgmulti.sh [-c] file_pattern
###############################################################################
# encrypt all non-gpg files recursively:
# find . -type f -not -name .DS_Store -not -name "*.gpg" -print0 | xargs -0 -o gpgmulti.sh -c
@ckirsch
ckirsch / Mac .profile Bash Script
Last active Feb 22, 2016
Mac .profile bash script managing MacPorts, MacTeX, Sublime, and git.
View Mac .profile Bash Script
# Mac OS X bash ~/.profile
# MacPorts Installer adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
# Use MacTeX rather than MacPorts for TeX
export PATH=/usr/texbin:$PATH
# Find my scripts
@ckirsch
ckirsch / Subcaptions
Created Mar 1, 2013
Multiple subfigures in LaTeX using the subcaption package.
View Subcaptions
...
\usepackage{subcaption}
...
\begin{figure}
\begin{center}
\begin{subfigure}[t]{0.48\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{image-a}
\caption{Subfigure A caption}
\label{fig:image-a}
@ckirsch
ckirsch / LaTeX Makefile
Created Mar 1, 2013
Makefile for LaTeX'ing and Bibtex'ing papers that may include xfig'ures. Supports pdflatex as well as latex, dvips, and epstopdf.
View LaTeX Makefile
##########################################################################
# LaTeX Makefile by Christoph Kirsch
#
# Do not remove any tab characters.
# Tab characters distinguish dependencies from commands.
##########################################################################
# Define the main file that includes all others and the bib file
# In local make script, define, e.g., 'export MAIN=other' to overwrite default
MAIN := paper
You can’t perform that action at this time.