Skip to content

Instantly share code, notes, and snippets.

@luishdez
luishdez / demo.js
Created May 23, 2012 22:57 — forked from sorensen/demo.js
Raphael icon factory
// If underscore is included on the page it will be added as a mixin,
// otherwise, it will be added to the global namespace
// Basic usage
icon('star', 'some-id-selector');
// Basic underscore usage
_.icon('home', 'home-id-selector');
// Advanced underscore usage
@luishdez
luishdez / icons.js
Created May 23, 2012 22:56
Raphael JS icons for Tumblr
var attributes = { fill: '#333', stroke: 'none' };
var icons = {
about: "M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M14.757,8h2.42v2.574h-2.42V8z M18.762,23.622H16.1c-1.034,0-1.475-0.44-1.475-1.496v-6.865c0-0.33-0.176-0.484-0.484-0.484h-0.88V12.4h2.662c1.035,0,1.474,0.462,1.474,1.496v6.887c0,0.309,0.176,0.484,0.484,0.484h0.88V23.622z",
address: "M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466zM19.158,23.269c-0.079,0.064-0.183,0.13-0.105,0.207c0.078,0.078-0.09,0.131-0.09,0.17s0.104,0.246,0.052,0.336c-0.052,0.092-0.091,0.223-0.13,0.301c-0.039,0.077-0.131,0.155-0.104,0.272c0.025,0.116-0.104,0.077-0.104,0.194c0,0.116,0.116,0.065,0.09,0.208c-0.025,0.144-0.09,0.183-0.09,0.285c0,0.104,0.064,0.247,0.064,0.286s-0.064,0.17-0.155,0.272c-0.092,0.104-0.155,0.17-0.144,0.233c0.014,0.065,0.104,0.144,0.091,0.184c-0.013,
@luishdez
luishdez / parsebind.pl
Created March 8, 2012 06:41 — forked from evandhoffman/parsebind.pl
Parses bind query logs to determine queries per second.
#!/usr/bin/perl
#use Date::Parse;
use Time::ParseDate;
my $line_num = 0;
my $first_line = 0;
my $oldest_record = 0;
my $line = '';
my $date = 0;
@luishdez
luishdez / roundedTimeZones.html
Created January 7, 2012 12:02
Time Zones rounded for Select
<!-- Time zones with half or quarter differences have been rounded to the nearest hour. -->
<option value="-10:America/Adak">-10 GMT: America/Adak</option>
<option value="-10:America/Atka">-10 GMT: America/Atka</option>
<option value="-9:America/Anchorage">-9 GMT: America/Anchorage</option>
<option value="-9:America/Juneau">-9 GMT: America/Juneau</option>
<option value="-9:America/Nome">-9 GMT: America/Nome</option>
<option value="-9:America/Yakutat">-9 GMT: America/Yakutat</option>
<option value="-8:America/Dawson">-8 GMT: America/Dawson</option>
<option value="-8:America/Ensenada">-8 GMT: America/Ensenada</option>
<option value="-8:America/Los_Angeles">-8 GMT: America/Los_Angeles</option>
@luishdez
luishdez / timezones.html
Created January 7, 2012 11:57
Timezones for select
<option value="-10:00">America/Adak</option>
<option value="-10:00">America/Atka</option>
<option value="-9:00">America/Anchorage</option>
<option value="-9:00">America/Juneau</option>
<option value="-9:00">America/Nome</option>
<option value="-9:00">America/Yakutat</option>
<option value="-8:00">America/Dawson</option>
<option value="-8:00">America/Ensenada</option>
<option value="-8:00">America/Los_Angeles</option>
<option value="-8:00">America/Tijuana</option>
@luishdez
luishdez / chainProcess.js
Created January 7, 2012 00:55
Simple chain for node.js
exports.chainProcess = function(){
this.lastError = false;
this.lastReturn = false;
this.uWorker = false;
this.chainPosition = -1;
this.chainnedFunctions = [];
this.chainnedCatchs = [];
@luishdez
luishdez / fstab
Created November 21, 2011 19:18
Prevent auto mount volumes on OS X Lion
# Get the list of volumes with: diskutil list
# find the UUID with: diskutil info /dev/disk0s2
# add records to /etc/fstab
UUID=B3C9CB71-21B7-30FA-B237-524FA53879DC none hfs rw,noauto
UUID=BCD30ECE-E60C-3E9F-B5AF-C7EF6C729B46 none hfs rw,noauto
<?php
/* E X A M P L E -----------------------------------------------
$feed = new RSS();
$feed->title = "RSS Feed Title";
$feed->link = "http://website.com";
$feed->description = "Recent articles on your website.";
$db->query($query);
$result = $db->result;
/*
Bernstein function:
1 = t + (1 - t)
Cuadratic beizer:
12 = (t + (1 - t))2
» 1 = t2 + 2t(1 - t) + (1 - t)2
Cuadratic beizer 3rd:
13 = (t + (1 - t))3
mobi_fx = {
show: function(o){o.style.display = 'block'},
hide: function(o){o.style.display = 'none'},
fadeIn: function(l){if(!l) l=1;mobi_fx.setOpacity(0); mobi_fx.show(mobi_modal.overlay); for(i=0;i<=1;i+=(1/50)){setTimeout("mobi_fx.setOpacity("+i*l+")",i*700);} setTimeout("mobi_fx.setOpacity("+l+")", 700); setTimeout("mobi_fx.show(mobi_modal.overlay)", 700);},
fadeOut: function(l){if(!l) l=1;for(i=0;i<=l;i+=(1/50)){setTimeout("mobi_fx.setOpacity("+(l-i)+")",i*700);}setTimeout("mobi_fx.hide(mobi_modal.overlay)", 700);},
ease: function(t,b,c,d){var s=1.30158; if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) +b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;},
animateTop: function(s,e){for(i=0;i<=1;i+=(1/60)){setTimeout("mobi_fx.setTop("+mobi_fx.ease(i,s,e,1)+")",i*1300);}},
animateHeight: function(s,e){for(i=0;i<=1;i+=(1/60)){setTimeout("mobi_fx.setHeight("+mobi_fx.ease(i, s, e-s,1)+")", i*500);}setTimeout("mobi_fx.setHeight("+e+")", i*500);},
s