This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Suppress mouse events if they hit panel with id "glassPane" | |
* unless a MouseDragged gesture is in process to ensure that every MouseClickedEvent that hits | |
* will be followed by an MouseReleasedEvent even if it's coords do not overlap any other nifty elements. | |
*/ | |
private final JoglInputSystem inputSystem = new JoglInputSystem() { | |
boolean niftyBusy=false; | |
@Override | |
public void mouseDragged(MouseEvent mouseEvent) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Taken from: http://www.movable-type.co.uk/scripts/sha256.html | |
Put into: http://closure-compiler.appspot.com/home | |
exports: | |
/** | |
* Generates SHA-256 hash of string | |
* | |
* @param {String} msg String to be hashed | |
* @param {Boolean} [utf8encode=true] Encode msg as UTF-8 before generating hash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ // Wrap everything up in a function | |
var count,person; // These become private to this wrapped scope, and do not clutter the global namespace. | |
count=0; // Modify private count var, | |
person= function(name){ | |
this.name = name; | |
count++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.gobmod={}; | |
window.gobmod.attachPlayer = function(elem){ | |
elem = $(elem); | |
var player = new Element('a',{'class':'modplaybutton', href: '#'}); | |
player.innerHTML='>' | |
elem.insert({top: player}); | |
// Start playback | |
var startPlayback=function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var client = net.connect(parseInt(process.argv[3]),process.argv[2],function(){ | |
client.setEncoding('utf8'); | |
console.log('Connected!!'); | |
client.on('data',function(chunk){ | |
console.log(chunk); | |
}); | |
process.stdin.resume(); // Activate STDIN | |
process.stdin.setEncoding('utf8'); // Set it to string encoding | |
process.stdin.on('data',function(chunk){ // Pipe STDIN to Socket.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "oscilloscope.h" | |
#define ANALOG_IN 0 | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
int val = analogRead(ANALOG_IN); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.ietf.org/rfc/rfc1928.txt | |
// Tested with: curl http://www.google.se/ --socks5 1080 --proxy-user foo:bar | |
var States = { | |
CONNECTED:0, | |
VERIFYING:1, | |
READY:2, | |
PROXY: 3 | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Raumod::BufferMapper | |
# See http://ruby-doc.org/core/classes/String.html#M001112 | |
# for map types. | |
def data_map;@data_map;end | |
def data;@data;end | |
def data_entry(method) | |
offset = data_map[method][:offset] | |
type = data_map[method][:type] | |
d = data[offset..-1].unpack(type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GravatarHelper | |
def gravatar_tag(email,*args) | |
opts = args.extract_options! | |
opts[:class]||="" | |
opts[:class]+=" gravatar" | |
size = opts.delete(:size) || 80 | |
require 'digest/md5' | |
default="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Element.getTransform= function (element){ | |
var properties = [ | |
'transform', | |
'WebkitTransform', | |
'MozTransform', | |
'msTransform', | |
'OTransform' | |
]; | |
var p; | |
while (p = properties.shift()) { |