This file contains 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 getElementsInRegion(x, y, width, height) { | |
var elements = [], | |
expando = +new Date, | |
cx = x, | |
cy = y, | |
curEl; | |
height = y + height; | |
width = x + width; |
This file contains 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
jQuery.easing.flicker = function(p, t, b, c) { | |
// p = progression: between 0 and 1 | |
// t = current time | |
// b = beginning value | |
// c = change in value | |
return (Math.random() > .5 ? p : 1) * c + b; | |
}; | |
// See the demo: http://jsbin.com/ihama |
This file contains 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 laugh() | |
{ | |
return | |
{ | |
haha: "ha!" | |
}; | |
} | |
laugh(); | |
// returns undefined |
This file contains 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
# Sounder sounds for class | |
# Requires an active microphone to pick up anything | |
require 'ruby-processing' | |
class MinimTest < Processing::App | |
load_library "minim" | |
import "ddf.minim" | |
import "ddf.minim.analysis" | |
This file contains 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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'uri' | |
require 'net/http' | |
require 'digest/md5' | |
require 'rexml/document' | |
require 'extlib' | |
require 'yaml' |
This file contains 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
$ godaddy buy wynn.fm | |
-- Reading CC Info from .godaddy... | |
-- THANK YOU FOR PURCHASING YOUR DOMAIN WITH GODADDY! | |
-- WHILE OUR SERVERS THINK ABOUT REGISTERING YOUR DOMAIN | |
-- NAME, PLEASE GIVE CAREFUL CONSIDERATION TO THE | |
-- FOLLOWING SPECIAL OFFERS!!! | |
Would you like to also register the following and SAVE 64%? | |
wynn.net |
This file contains 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
// do the hack | |
document.childNodes[1].style.width = "100%"; // set the HTML to 100%/100% | |
document.childNodes[1].style.height = "100%"; | |
document.body.style.width = "100%"; // set the <body> to 100%/100% | |
document.body.style.height = "100%"; | |
var viewportDimsHack = this.treeBrowserDocument.createElement("div"); | |
viewportDimsHack.style.position = "fixed"; | |
viewportDimsHack.style.left = "0px"; | |
viewportDimsHack.style.top = "0px"; |
This file contains 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
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
// Simple test program invoked with an option to eagerly | |
// compile all code that is loaded in the isolate. | |
// VMOptions=--compile_all | |
class HelloDartTest { | |
static testMain() { | |
print("Hello, Darter!"); |
This file contains 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
/** | |
* parseTemplate takes a string and a JS Object and returns a string with template | |
* replaced with content you provided. Template tags look like: {{tag}} | |
* @param {String} s This is the string to search for tags in. | |
* @param {Object} j This is the JS object that contains a key=>value pair for the tag and what to be replaced | |
* @returns {String} returns the modified string with the content you provided in replacement of the tags | |
* @example var html = parseTemplate('Hey, {{name}}',{ name:'John' }); //returns "Hey, John" | |
*/ | |
var parseTemplate = function(s,j){ | |
for(x in j){ var r = new RegExp('{{'+x+'}}','g'); s = s.replace(r,j[x]); } |
This file contains 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
#!/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/2492984/hack.sh | sh | |
# |
OlderNewer