Skip to content

Instantly share code, notes, and snippets.

View jrk's full-sized avatar

Jonathan Ragan-Kelley jrk

View GitHub Profile
@cpjolicoeur
cpjolicoeur / gist:1855097
Created February 17, 2012 19:50 — forked from folke/gist:1453374
Gmail to OmniFocus
javascript:(function(){
if(top.document == document) {
var msg = document.getElementById("canvas_frame");
if(msg){
subjectEl = msg.contentDocument.getElementsByClassName("hP");
subject = subjectEl[0].innerText;
bodyEl = msg.contentDocument.getElementsByClassName("adP");
body = bodyEl[0].innerText;
@dz0ny
dz0ny / 99java
Created July 7, 2012 10:23
Install java,flash,mp3,mp4 to Chromium OS
## Setup java
if [ `uname -m` == 'x86_64' ]; then
PATH="/usr/lib64/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib64/jvm/java-7-oracle/"
else
PATH="/usr/lib/jvm/java-7-oracle/jre/bin/"
JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
fi
@danchoi
danchoi / xmonad-lion.md
Created October 20, 2012 13:08
My Xmonad installation recipe for OS X Lion

My Xmonad recipe for OS X Lion

My recipe for setting up Xmonad on Ubuntu GNU/Linux is here.

What is xmonad? Read this page to learn.

Some of these instructions were adapted from the Source Matters Blog. But I also depart from those instructions in certain ways.

@danchoi
danchoi / xmonad-ubuntu.md
Created October 20, 2012 14:39
Setting up Xmonad in Ubuntu Oneiric
@quarnster
quarnster / cmake_options_script.py
Created October 24, 2012 05:40
SublimeClang options script taking the compilation commands from CMake. Based on @berenm's pull request https://github.com/quarnster/SublimeClang/pull/135
# Based on @berenm's pull request https://github.com/quarnster/SublimeClang/pull/135
# Create the database with cmake with for example: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
# or you could have set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in your CMakeLists.txt
# Usage within SublimeClang:
# "sublimeclang_options_script": "python ${home}/code/cmake_options_script.py ${project_path:build}/compile_commands.json",
import re
import os
import os.path
@jrk
jrk / gist:3949931
Created October 25, 2012 01:17
Valid chunk choices
f(v0, v1) = v0*v1
g(v2, v3, v4) = f(v2, v3)
h(v5, v6) = g(v5, v6, 0) + g(v5, v6, 1)
h.root() // h is output, so this is implicit
// this means:
[allocate h]
for all v6:
for all v5:
h[v5,v6] = g(v5,v6,0) + g(v5,v6,1)
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@jjgod
jjgod / CCacheMacNinja.md
Last active July 1, 2024 16:29
Using ccache for Mac builds

Introduction

ccache is a compiler cache. It speeds up recompilation of C/C++ code by caching previous compilations and detecting when the same compilation is being done again. This often results in a significant speedup in common compilations, especially when switching between branches. This page is about using ccache on Mac with clang and ninja build system. If you want to use Xcode, please refer to the old CCacheMac page.

In order to use ccache with clang, you need to use the current git HEAD, since the most recent version (3.1.9) doesn't contain the patch needed for using chromium style plugin.

Installation

To install ccache with [homebrew](http://mxcl.

@minrk
minrk / git-aliases.sh
Created July 29, 2013 19:37
preserving completion for git aliases.
# define some aliases
alias m="git checkout master"
alias mp="git checkout master && git pull"
alias ci="git commit"
alias c="git checkout"
alias co="git checkout"
alias b="git checkout -b"
alias pr="git push mine && hub pull-request"
alias uncommit="git log -1 && git reset HEAD^1"
@robulouski
robulouski / gmail_imap_example.py
Last active February 16, 2025 12:05
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib