Skip to content

Instantly share code, notes, and snippets.

@tzafrir
tzafrir / pre.c
Created January 25, 2011 15:56
Macro to output string
#define call(foo) "call " #foo
call(q)
#ifndef __BOA_CONSTRAINT_PROBLEM_H__
#define __BOA_CONSTRAINT_PROBLEM_H__
#include <vector>
#include "Constraint.h"
using std::vector;
namespace boa {
#ifndef __BOA_CONSTRAINT_PROBLEM_H__
#define __BOA_CONSTRAINT_PROBLEM_H__
#include <vector>
#include "Constraint.h"
using std::vector;
@tzafrir
tzafrir / gist:813306
Created February 6, 2011 11:26
gedit external tool wrapper for gist.sh
#!/bin/sh
gnome-www-browser `gist.sh -f $GEDIT_CURRENT_DOCUMENT_PATH`
@tzafrir
tzafrir / index.html
Created April 24, 2011 18:28
Youtube Remixer draft
<doctype html>
<html><head><title>Youtube Mixer</title>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load("swfobject", "2.1");
function _run() {
var videoID = "HgzGwKwLmgM"
var params = { allowScriptAccess: "always" };
var atts = { id: "y1", allowFullScreen: true };
@tzafrir
tzafrir / gist:1068638
Created July 7, 2011 00:04
Google+ nitificator
javascript:function f() {var n = document.getElementById('gbi1').innerHTML; if (n == 0) {document.title = "Google+"} else { document.title = "(" + n + ") Google+" } }; window.setInterval(f, 1000)
@tzafrir
tzafrir / xorg.conf
Created March 19, 2012 01:00
Nvidia-xconfig output with added CustomEDID
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 280.13 (buildmeister@swio-display-x86-rhel47-03.nvidia.com) Wed Jul 27 17:15:58 PDT 2011
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
@tzafrir
tzafrir / gist:2088413
Created March 19, 2012 01:02
xorg.conf before this started - worked fine with previous gfx card (Geforce 8800)
Section "Screen"
Identifier "Default Screen"
DefaultDepth 24
EndSection
Section "Module"
Load "glx"
EndSection
.replace(/(([\s()\.,!?]|^)((<[^>]*>)|[-_])*)\*([^\n]*?[^\s])\*(((<[^>]*>)|[-_])*([()\.,!?]|$|\s))/g, '$1<b>$5</b>$6')
.replace(/(([\s()\.,!?]|^)((<[^>]*>)|[-\*])*)_([^\n]*?[^\s])_(((<[^>]*>)|[-\*])*([()\.,!?]|$|\s))/g, '$1<i>$5</i>$6')
.replace(/(([\s()\.,!?]|^)((<[^>]*>)|[\*_])*)-([^\n]*?[^\s])-(((<[^>]*>)|[\*_])*([()\.,!?]|$|\s))/g, '$1<s>$5</s>$6')
@tzafrir
tzafrir / gist:3737339
Created September 17, 2012 13:44
linked list
import java.lang.IndexOutOfBoundsException;
public class Main {
public static void main(String args[]) {
LinkedList<Integer> l = new LinkedList<Integer>();
l.add(4);
l.add(0);
l.add(9);
l.add(131, 1);
l.add(12);