Skip to content

Instantly share code, notes, and snippets.

View hsigrist's full-sized avatar
👽
Cofusing

Hans Sigrist hsigrist

👽
Cofusing
View GitHub Profile
@hsigrist
hsigrist / .emacs
Created January 23, 2016 06:14 — forked from even4void/.emacs
A basic previewer for R Markdown files edited with Emacs
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.Rmd\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.rmd\\'" . markdown-mode))
(add-hook 'markdown-mode-hook 'turn-on-outline-minor-mode)
(defun rmarkdown-new-chunk (name)
"Insert a new R chunk."
(interactive "sChunk name: ")
(insert "\n```{r " name "}\n")
(save-excursion
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
export PATH="/usr/local/bin:$PATH"
export PATH="/Library/TeX/texbin:$PATH"
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
;;("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(package-initialize)
;; AucTeX fix PATH & XeLaTeX fix
(setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t)
(setq org-latex-pdf-process '("latexmk -pdflatex='xelatex -synctex=1 --shell-escape' -pdf %f"))
@hsigrist
hsigrist / multi-git.md
Created December 8, 2015 08:03 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.

@hsigrist
hsigrist / Shell Turtlestein.sublime-settings
Created August 23, 2015 15:27
Shell Turtlestein User
{
// Override these in your own
// `Packages/User/Shell Turtlestein.sublime-settings` file.
"surround_cmd": ["source ~/.profile && ", ""],
"exec_args": {},
"cmd_settings": [],
"input_widget": {
// overridden for silly non-unixy OSes
"syntax": "Packages/ShellScript/Shell-Unix-Generic.tmLanguage"
}
{
// Your GitHub API token
// see: https://github.com/condemil/Gist#generating-access-token
"token": "847ba2bb5fc7c038bcb70463bcc47f9401370a1e",
// Show GitHub organizations
// Example: "company1", "company2"
"include_orgs": [],
// Show GitHub users
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
export PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH
export RBENV_ROOT=/usr/local/var/rbenv
export PATH="/usr/local/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH=$homebrew:$PATH
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
alias st='open -a "Sublime Text"'
alias blog='cd ~/Dropbox/blog/octopress'
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
export PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH
export RBENV_ROOT=/usr/local/var/rbenv
export PATH="/usr/local/bin:$PATH"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH=$homebrew:$PATH
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
alias st='open -a "Sublime Text"'
alias blog='cd ~/Dropbox/blog/octopress'