Skip to content

Instantly share code, notes, and snippets.

@lukas2
lukas2 / gist:670757
Created November 10, 2010 11:56
tmux
set-option -g prefix C-a
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
# Highlight active window
set-window-option -g window-status-current-bg red
@lukas2
lukas2 / DD
Created November 15, 2010 14:27
send(to, from, count)
register short *to, *from;
register count;
{
register n=(count+7)/8;
switch(count%8){
case 0: do{ *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
send(to, from, count)
register short *to, *from;
register count;
{
register n=(count+7)/8;
switch(count%8){
case 0: do{ *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
send(short *to, short *from, int count)
{
int n=(count+7)/8;
if(count%8 == 0) goto label_case0;
if(count%8 == 1) goto label_case1;
if(count%8 == 2) goto label_case2;
if(count%8 == 3) goto label_case3;
if(count%8 == 4) goto label_case4;
if(count%8 == 5) goto label_case5;
public class App {
public static void main(String[] args) {
Integer b = 400;
Integer c = 400;
System.out.println(b == c); // => false
Integer b1 = 1;
Integer c1 = 1;
System.out.println(b1 == c1); // => true
@lukas2
lukas2 / hack.sh
Created March 31, 2012 11:25 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@lukas2
lukas2 / gist:4642666
Created January 26, 2013 14:22
Just a crappy little Rails-helper for Twitter cards and Open Graph metadata.
require 'rubygems'
require 'action_view'
require 'erb'
class MetadataHelper
include ActionView::Helpers::TagHelper
def initialize( opts = {} )
@title = opts[:title]
function decryptc(){
pbpaste > /tmp/encrypted_message.txt; gpg -d /tmp/encrypted_message.txt | pbcopy; rm /tmp/encrypted_message; pbpaste
}
function encryptc(){
pbaste | gpg -e -a -r $1 | pbcopy
}

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@lukas2
lukas2 / Marks
Last active December 21, 2015 05:39
# src: http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
export MARKPATH=$HOME/.marks
function jump {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function unmark {