This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#rotate android 3gp video and transcode to mp4 | |
# mit / gpl and all that | |
# copyright 2010 ryan day, ryanday.org | |
# | |
#NOTE: OGG CONVERSION IS FAILING FOR SOME REASON | |
# | |
#PURPOSE: | |
# to rotate and transcode a 3gp/h.263 video, amr audio to mp4/h.264 , mp3 audio | |
# to take the mp4 and make a compatable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CPA LEAD AD NERF - stop cpa lead embedded ad widgets | |
copyright 2010 ryan day | |
http://ryanday.org | |
mit /gpl and all that | |
*/ | |
/* | |
a co worker ran into a real ugly ad server that binds all sorts of unload callbacks and uses bad messaging in the onbefore unload confirmation box that would cause you to stay instead of leave. All to try and keep flashing ads in your face. | |
the source: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*php enable gzip ... safely function. | |
Sometimes its hard to guarantee that output has not been started and that output has not already been written to a buffer. most of the time you are asked to make a site perform better and they want it now. | |
copyright ryanday 2010 | |
http://ryanday.org | |
mit/lgpl and all that | |
this function will only start gzip if it can. | |
this function will take the contents of all currently active output buffers and echo their contents after gzip headers have been set into the gzip buffer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* async method chaining pattern jquery reflection. | |
this a en example of how to reflect the jquery / any object into a proxy and use | |
async method chaining pattern is discussed here by dustin diaz of twitter | |
http://www.dustindiaz.com/async-method-queues/ | |
*/(function($){ | |
var Queue = function(chain){this.q = chain||[]}; | |
Queue.prototype = { | |
q:[], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /*quick and useful benchmarking static class | |
copyright Ryan Day 2010 | |
http://ryanday.org | |
lgpl | |
USE: | |
bench::mark('all'); | |
sleep(1); | |
bench::mark('app'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /*mongodb custom php session handler | |
copyright 2010 ryan day | |
lgpl | |
*/ | |
$mongo = new Mongo(); | |
//MongoSession::setConfig('collection','session_test'); | |
$mongo_session = new MongoSession($mongo); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*javascript rank password function | |
copyright ryanday 2010 | |
mit/gpl license | |
feel free to use and include as long as the code retains the above copyright. =) | |
PURPOSE: | |
i needed to present users with a password quality visual alert on keyup for the password on a registration form. this is the core function with no depends | |
USE://jquery example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#assumed su | |
pecl install -B memcached | |
if [ -d "/usr/share/php5/PEAR/pear/download" ] | |
then | |
# openSuse 11.3 | |
cd /usr/share/php5/PEAR/pear/download | |
cd `ls | grep memcached` | |
else | |
# openSuse 11.2 | |
cd /usr/local/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
~>php bench.php | |
md5_file 634.3932 ms | |
hash_file/md5 714.4802 ms | |
parse contents 911.6130 ms | |
parse contents substr 852.8361 ms | |
contents first chunk 590.0660 ms | |
all ran with 30000 itterations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cpy = function(a){return Array.prototype.slice.call(a)} | |
,appendTo = function(b,a){var c = cpy(b);c.unshift(a.length,0);a.splice.apply(a,c);return a} | |
,appendToCopy = function(b,a){return appendTo(b,cpy(a))} | |
module.exports = {copy:cpy,appendTo:appendTo,appendToCopy:appendToCopy}; |
OlderNewer