Skip to content

Instantly share code, notes, and snippets.

@phiggins42
phiggins42 / .zshrc
Created November 27, 2013 15:01 — forked from SlexAxton/.zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@phiggins42
phiggins42 / handlebars.js
Created November 15, 2011 13:45 — forked from svnlto/handlebars.js
dojo handlebars.js
dojo.provide("dbp._Handlebars");
dojo.require("dijit._TemplatedMixin");
(function(d) {
// lib/handlebars/parser.js
/* Jison generated parser */
var handlebars = (function(){
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1},
<div class='edujiniAddFeed' dojoAttachPoint='domNode'>
<button>Add a subscriptions</button><br>
<div></div>
<div dojoAttachPoint="containerNode"></div>
</div>
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
// Excerpt from http://www.mtv.com/sitewide/scripts/reporting/mtvi_reporting.js
/*Build Date: Fri May 15, 2009 14:20:51*/
try {
var com = typeof com === 'object' ? com : {};
com.mtvi = typeof com.mtvi === 'object' ? com.mtvi : {};
com.mtvi.util = typeof com.mtvi.util === 'object' ? com.mtvi.util : {};
com.mtvi.logger = typeof com.mtvi.logger === 'object' ? com.mtvi.logger : {};
com.mtvi.config = typeof com.mtvi.config === 'object' ? com.mtvi.config : {};
com.mtvi.ads = typeof com.mtvi.ads === 'object' ? com.mtvi.ads : {};
dojo.declare('hitpost.Search', dijit._Widget, {
// not necessary:
// searchTimeout : null,
cache : {}, // NOTE: thisis a shared member, like a static. create it in postCreate
// if you want a unique cache for each instance. Otherwise, thisis fine.
// no need for a blank constructor
// constructor : function(args) { },

HOWTO: iPhone AT&T Tethering

In 10 steps:

  • Update iTunes to 8.2 via Software Update
  • Update your iPhone to the 3.0 release (out today - June 17th)
  • Download this dmg and mount it: tethering file
  • Enable hidden carrier testing option (in Terminal.app): defaults write com.apple.iTunes carrier-testing -bool TRUE
  • Start up iTunes