Skip to content

Instantly share code, notes, and snippets.

View eduardocereto's full-sized avatar
💩

Eduardo Cereto Carvalho eduardocereto

💩
View GitHub Profile
@eduardocereto
eduardocereto / hack.sh
Created March 31, 2012 19:43 — forked from erikh/hack.sh
OSX For Hackers
#!/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/2108403/hack.sh | sh
#
@eduardocereto
eduardocereto / champagne.js
Created March 2, 2012 00:11 — forked from mislav/champagne.js
Emulate "submit" and "change" events bubbling in IE for Prototype 1.7
/** Emulate "submit" and "change" events bubbling
*
* This plugin enables handling bubbling submit/change events by browsers which
* natively don't support this. It only augments `Element.on()` method and doesn't
* fix when this events are observed with `observe()`.
*/
;(function() {
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
function isEventSupported(eventName) {
@eduardocereto
eduardocereto / current.js
Created January 18, 2012 18:46
Current AJAX Response / Proposed AJAX Response
{
"content": "HTML CONTENT HERE", //content redacted for clearnes
"bg": "bg-g-100",
"title": "Enter Your Address",
"analytics": [
[
"&lt",
"script type=\"text/javascript\"&gt",
"<br /> var _gaq = _gaq || []",
"<br /> _gaq.push(['_setAccount', 'UA-17812842-1'])",
@eduardocereto
eduardocereto / gist:1204707
Created September 8, 2011 21:04 — forked from yahelc/gist:1004702
Simpler Twitter Intents / Google Analytics Script
(function(){
var event_names = {
"click" : "" ,
"tweet" : "",
"retweet" : "source_tweet_id",
"follow" : "screen_name",
"favorite" : "tweet_id"
};
for(var event_name in event_names) {
@eduardocereto
eduardocereto / cb_addEventListener.js
Created May 4, 2011 17:45
a cross-browser implementation of addEventListener/AttachEvent without external dependencies
/**
* Cross Browser helper to addEventListener.
*
* @param {HTMLElement} obj The Element to attach event to.
* @param {string} evt The event that will trigger the binded function.
* @param {function(event)} fnc The function to bind to the element.
* @return {boolean} true if it was successfuly binded.
*/
var cb_addEventListener = function(obj, evt, fnc) {
// W3C model
@eduardocereto
eduardocereto / bundle-to-ebs.sh
Created December 18, 2009 18:02 — forked from fairchild/bundle-to-ebs.sh
bundle s3 AMI to EBS
#!/bin/bash -xe
EBS_DEVICE='/dev/sdh'
INSTANCE_ID=$1
AKI=${2:-'aki-5f15f636'}
ARI=${3:-'ari-0915f660'}
ARCH=${4:-'i386'}
SIZE=${5:-10}
AZ=${6:-'us-east-1d'}
NAME=${7:-"ami-from-$INSTANCE_ID"}