Skip to content

Instantly share code, notes, and snippets.

View yeco's full-sized avatar

Jasson Cascante yeco

View GitHub Profile
@yeco
yeco / gist:1110218
Created July 27, 2011 19:51 — forked from getify/gist:1110207
ugly hack to figure out the actual viewport dimensions (sans scrollbars)
// 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";
@yeco
yeco / GoDaddy CLI
Created June 21, 2011 07:03 — forked from ernie/GoDaddy CLI
If GoDaddy did CLI domain registration...
$ 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
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'uri'
require 'net/http'
require 'digest/md5'
require 'rexml/document'
require 'extlib'
require 'yaml'
# 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"
@yeco
yeco / laughable.js
Created February 19, 2010 06:26 — forked from dandean/laughable.js
function laugh()
{
return
{
haha: "ha!"
};
}
laugh();
// returns undefined
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
function getElementsInRegion(x, y, width, height) {
var elements = [],
expando = +new Date,
cx = x,
cy = y,
curEl;
height = y + height;
width = x + width;