Skip to content

Instantly share code, notes, and snippets.

View irae's full-sized avatar

Irae Carvalho irae

View GitHub Profile
@alunny
alunny / description.md
Created November 26, 2010 22:22
my git configuration

My Git Configuration

For best results, use hub and git bash completion (included with git under contrib/completion).

@paulirish
paulirish / gist:747835
Created December 19, 2010 23:37
`x || (x = y)` pattern for using an incoming value otherwise using some default
// from https://twitter.com/#!/LeaVerou/status/16613276313980929
// this pattern below is common for using an incoming value otherwise using some default.
/* Bad: */ x = x ? x : y; // simple ternary.
// if x is truthy lets use it.
/* Better: */ x = x || y; // logical OR.
// you could string a bunch of these easily to grab the first non-falsy value:
@WebReflection
WebReflection / fake-script.js
Created August 24, 2011 19:03
hot to mock script requests
document.createElement = function (
createElement, // the native one
createResponse // the function "in charge"
) {
return function (nodeName) {
var result, src;
// if we are creating a script
if (/^script$/i.test(nodeName)) {
// result will be a place holder
result = createElement.call(
@jcarbaugh
jcarbaugh / compatibility.py
Created May 18, 2009 17:43
Django middleware for X-UA-Compatible HTTP header
# Copyright (c) 2009, Sunlight Foundation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@ernie
ernie / GoDaddy CLI
Created April 6, 2011 15:45
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
@jeffrafter
jeffrafter / ie6.sh
Created August 11, 2011 16:04
Setup a VirtualBox instance that allows you to test IE Locally from OSX
#!/bin/bash
# Much of this came from a few blog articles and one base script that I can't find now
# It is updated for the current VHD files (which supposedly expired on Aug 9th, 2011
# but still work.
#
# Requirements: Virtual Box installed, unrar (from homebrew is fine)
#
# If you want to remove stuff, open up Virtual Box and remove the VM and delete files.
#
@jed
jed / LICENSE.txt
Created May 10, 2011 16:04 — forked from 140bytes/LICENSE.txt
write contextual templates
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@fcalderan
fcalderan / inception-javascript.js
Created November 2, 2010 09:42
inception explained as a 4 nested javascript closures
/*
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02
* I had an idea: could Inception movie be explained by a few javascript closures
* and variable resolution scope (just for fun)?
*
* Activate javascript console =)
*/
<script>
console.group("inception movie");
@derek-watson
derek-watson / tumblr.rb
Created March 12, 2011 18:47
Tumblr to Jekyll migration
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
# Supports post types: regular, quote, link, photo, video and audio
# Saves local copies of images
require 'rubygems'
require 'open-uri'
require 'nokogiri'
@rmm5t
rmm5t / README.md
Created August 19, 2008 23:38
Locale override examples for the timeago jQuery plugin (http://timeago.yarp.com)

This gist is now deprecated

Please visit the locales directory inside the main timeago repository intead.