Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import sys
import errno
import ctypes
try:
libc = ctypes.CDLL('libc.dylib')
except OSError:
libc = ctypes.CDLL('/lib/libc.so.6')
from struct import *
from ctypes import *
from win32con import *
from win32clipboard import *
from win32api import *
from ctypes import create_string_buffer as bytes
gdip = windll.gdiplus
kernel32 = windll.kernel32
jpegFmtGuid = pack("IHHBBBBBBBB", 0xb96b3cae, 0x0728, 0x11d3, 0x9d,
function pgrep ()
{
ps auxwww |
grep -e "$1" |
grep -v grep |
sed 's@[ ] *@ @' |
cut -d' ' -f2
}
/* Buzz bookmarklet, this should work on older browsers*/
var e=encodeURIComponent;
var b='http://www.google.com/buzz/post';
var u=e(document.location.href);
var els=document.getElementsByTagName('meta');
var o=null;
for(var i=0;i<els.length;i++){
if(els[i].name=='description'){
o=els[i];
class Position { int x = 0; int y = 0; }
class Delta { int dx = 0; int dy = 0; }
class RectArea
{
Position position = new Position();
Delta delta = new Delta();
color fillColor;
int opacity;
abstract class Classification {
double frequency()
boolean isComplete()
boolean isPartial()
...
class Complete extends Classification ...
class Partial extends Classification ...
class Partialish extends Classification ...
class Nothing extends Classification ...
$ ./osstatus -108
Error number: -108 / 0xffffff94
Error string: memFullErr / iMemFullErr
Error description: Not enough room in heap zone /
@silverjam
silverjam / blip-next-click.js
Created November 19, 2010 02:50
Example of jQuery.click not working.
// Tested on http://blip.fm/home page
// Works
(function() {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
var cb = document.getElementById("prevPageLinkTop");
cb.dispatchEvent(evt);
})()
#include <cstdio>
struct klass1
{
bool operator!() { return false; }
};
struct klass2
{
klass1 operator!() { return klass1(); }
@silverjam
silverjam / killzergs.js
Created April 28, 2012 01:23
Cheat for Google's "zerg rush" Easter egg
// Paste in to JavaScript console
function killzergs()
{
var zergs = document.getElementsByClassName("zr_zergling_container");
for(x = 0; x < zergs.length; x = x + 1) {
var evt = document.createEvent("HTMLEvents");
evt.initEvent('mousedown', true, true );
zergs[x].dispatchEvent(evt);
var evt = document.createEvent("HTMLEvents");
evt.initEvent('mouseup', true, true );