Skip to content

Instantly share code, notes, and snippets.

View eduardocereto's full-sized avatar
💩

Eduardo Cereto Carvalho eduardocereto

💩
View GitHub Profile
@eduardocereto
eduardocereto / ga-addthis.html
Created June 7, 2012 08:59 — forked from googleanalyticsresoneo/ga-addthis.html
AddThis and Google Analytics integration
<script type="text/javascript">
// standard GA async code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
@eduardocereto
eduardocereto / gist:2312353
Created April 5, 2012 16:29 — forked from anonymous/gist:2309745
Track Client-Side Errors with Google Analytics
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);
_gaq.push(['_setDomainName', 'yoursite.com']);
_gaq.push(['_addIgnoredRef', 'yoursite.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@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 / 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 / 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"}