Skip to content

Instantly share code, notes, and snippets.

View IvanTorresEdge's full-sized avatar
🔮
Everything!

Ivan Torres IvanTorresEdge

🔮
Everything!
View GitHub Profile
@IvanTorresEdge
IvanTorresEdge / gist:2651275
Created May 10, 2012 05:45
CacheFly's Purge Performance Test
#!/usr/bin/env ruby
require 'rubygems'
require 'aws-sdk'
require 'base64'
require 'benchmark'
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
/*
* a backwards compatable implementation of postMessage
* by Josh Fraser (joshfraser.com)
* released under the Apache 2.0 license.
*
* this code was adapted from Ben Alman's jQuery postMessage code found at:
* http://benalman.com/projects/jquery-postmessage-plugin/
*
* other inspiration was taken from Luke Shepard's code for Facebook Connect:
* http://github.com/facebook/connect-js/blob/master/src/core/xd.js
(function () {
var go = function go () {
};
if (window.addEventListener) {
window.addEventListener('load', go, false);
} else if (window.attachEvent) {
window.attachEvent('onload', go);
}
})();
@IvanTorresEdge
IvanTorresEdge / gist:3456355
Created August 24, 2012 22:17
Disable IPv6 Mountain Lion
networksetup -listallnetworkservices
networksetup -setv6off Ethernet
networksetup -setv6off Wi-Fi
@IvanTorresEdge
IvanTorresEdge / iptables.sh
Created September 9, 2012 03:25
IP Tables for Postgresql
# become root
sudo -i
# flush all existing rules
iptables -F
# Accept traffic from existing connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# accept SSH connections
var walk = require('./walk');
var TEST_DIRECTORY = process.cwd() + '/public/test/app';
var renderView = function (res, filenames) {
var conf = { filenames: filenames };
view = process.cwd() + '/assets/test/runner.hbs';
res.render(view, conf);
};
@IvanTorresEdge
IvanTorresEdge / mixins.less
Created September 26, 2012 21:33
Collection of Useful Mixin
// to be used only when all the corners have the same radius (and unit)
.border-radius(@radius) {
-webkit-border-radius: @radius;
border-radius: @radius;
}
// specify radius per corner (and probably units)
.border-radius(@top-left, @top-right, @bottom-right, @bottom-left) {
border-top-left-radius: @top-left;
border-top-right-radius: @top-right;
<a class="button" disabled="disabled">Link</a>
@IvanTorresEdge
IvanTorresEdge / generate_urls.coffee
Created October 2, 2012 15:23
Generate URL helper methods for Backbone router
# generates URL functions for each of the routes
#
# #### Example:
#
# Given the following routes
#
# routes:
# '/posts/:id' : 'showPost'
# '/posts/:id/comments' : 'comments'
#
@IvanTorresEdge
IvanTorresEdge / build.js
Created October 11, 2012 06:48 — forked from jrburke/build.js
Doing multiple almond builds with a nodejs script, example
//Download jquery.js and place it in the build, do not use require-jquery.js
//in the build, since each of the build layers just needs almond and not the
//full require.js file.
//This file is run in nodejs to do the build: node build.js
//Load the requirejs optimizer
var requirejs = require('./r.js');
//Set up basic config, include config that is
//common to all the requirejs.optimize() calls.