Skip to content

Instantly share code, notes, and snippets.

View sneak's full-sized avatar

Jeffrey Paul sneak

View GitHub Profile
@romac
romac / Makefile
Created July 15, 2011 13:36
Markdown to PDF
TEMP_DIR:=$(shell mktemp -d -t /tmp)
MARKDOWN=perl Resources/Markdown.pl
WKHTMLTOPDF=/usr/local/bin/wkhtmltopdf
BUILD_DIR=Build
MD_OUTPUT=Documentation.md
HTML_OUTPUT=Documentation.html
PDF_OUTPUT=Documentation.pdf
COVER=__Couverture
@bemasher
bemasher / error.go
Created March 9, 2012 07:30
An error handling package for Golang.
package error
import (
"os"
"fmt"
"runtime"
"path/filepath"
)
// Handle an error for the calling function
@venj
venj / com.yourcompany.autossh.plist
Created May 30, 2012 14:39
Put following gist to ~/Library/LaunchAgents, and then run: launchctl load /Users/your_name/Library/LaunchAgents/com.yourcompany.autossh.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OnDemand</key>
<false/>
<key>KeepAlive</key>
<true/>
@amix
amix / Reddits_Algorithm.py
Created March 24, 2013 02:14
The confidence sort algorithm is implemented in _sorts.pyx, I have rewritten their Pyrex implementation into pure Python (do also note that I have removed their caching optimization)
#Rewritten code from /r2/r2/lib/db/_sorts.pyx
from math import sqrt
def _confidence(ups, downs):
n = ups + downs
if n == 0:
return 0
import os, sys
markdown_name = sys.argv[1]
name = markdown_name.split(".")[0]
latex_name = name + ".tex"
os.system("pandoc -f markdown -t latex %s -o %s" % (markdown_name, latex_name))
with open(latex_name, "r") as latex_file:
latex_content = latex_file.read()
@tatygrassini
tatygrassini / 1001-albums
Last active July 4, 2023 20:47
1001 Albums You Must Hear Before You Die
1001 Albums You Must Hear Before You Die
List taken from then book edited by Robert Dimery.
Missing from the list:
Machito - Kenya 1957
Jack Elliot - Jack Takes The Floor 1958
Dolly Parton - Coat Of Mahy Colors 1971
George Jones - The Grand Tour 1974
R.D. Burman / Bappi Lahiri - Shalimar / College Girl 1975
@eculver
eculver / replace_apt_sources.sh
Created December 26, 2013 00:02
Replace default Ubuntu apt repository URLs w/ DigitalOcean's
sudo sed -i "s/archive\.ubuntu/mirrors.digitalocean/g" /etc/apt/sources.list
@rnix
rnix / .gitignore
Last active June 25, 2020 04:09 — forked from dbehnke/gorilla-go-json-rpc-test.go
Gorilla RPC/v2 example
gorilla-go-json-rpc-test
gorilla-go-json-rpc-test.out
@reiki4040
reiki4040 / signal.go
Created October 2, 2014 14:38
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@izderadicka
izderadicka / megaback.sh
Last active February 7, 2022 04:53
backup script for megatools
#!/bin/bash
BACKUP_DIR="/Root/Backup/"
PIECE_SIZE=10M
ACTION=store
trap "exit 2" SIGINT
if [[ $1 =~ -h|--help ]]; then