This file contains hidden or 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 | |
# Use mencoder to create a video from image and audio files | |
# http://fmtyewtk.blogspot.com/2009/10/how-to-create-video-from-mp3-using.html | |
# suggests that we cannot use just 1 image file but the following seems to work (though | |
# vlc reports the video codec is NOT h264) | |
mencoder "mf://$1" -mf fps=1/60 -audiofile "$2" -oac mp3lame -ovc lavc -lavcopts vcodec=libx264 -noskip -mc 0 -ovc copy -o "$3" |
This file contains hidden or 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/bash | |
# forward my local port (e.g., 3000) to REMOTE_HOST's port | |
# and run top to keep tunnel from closing | |
ssh -t -g -R :$REMOTE_PORT:0.0.0.0:$LOCAL_PORT $REMOTE_HOST "top d 15" |
This file contains hidden or 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
# Set heroku account credentials where each account file is named ~/.heroku/credentials_XXX | |
# http://www.mail-archive.com/[email protected]/msg03850.html | |
function hset() { | |
ln -s ~/.heroku/credentials_$1 ~/.heroku/credentials | |
} | |
# Clear current Heroku account | |
function hclear() { | |
[ -L ~/.heroku/credentials ] && rm ~/.heroku/credentials | |
} |
This file contains hidden or 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
export ARCHFLAGS="-arch x86_64" | |
gem install mysql \ | |
-- \ | |
--with-mysql-dir=/usr/local/mysql \ | |
--with-mysql-config=/usr/local/mysql/bin/mysql_config |
This file contains hidden or 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 | |
T_START=01:00:00 | |
T_END=${FROM} | |
FNAME=sample.mp4 | |
cvlc --video-filter scene -V image --start-time ${T_START} --stop-time ${T_END} --scene-format jpg --scene-ratio 24 --scene-prefix snap ${FNAME} vlc://quit 2>&1 |
This file contains hidden or 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
---> Computing dependencies for postgresql83-server | |
---> Fetching postgresql83-server | |
---> Verifying checksum(s) for postgresql83-server | |
---> Extracting postgresql83-server | |
---> Configuring postgresql83-server | |
---> Building postgresql83-server | |
---> Staging postgresql83-server into destroot | |
---> Creating launchd control script | |
########################################################### | |
# A startup item has been generated that will aid in |
This file contains hidden or 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
# add git branch and rvm ruby@gemset in addition to the usual \u \h \w | |
source "$rvm_path/contrib/ps1_functions" | |
ps1_set |
This file contains hidden or 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
function iterateOver(arry, div) { | |
var ol = $(document.createElement("ol");); | |
ol.class("records_list"); | |
div.append(ol); | |
$.each(arry, function(i, item) { | |
ol.append("<li>" + item.value + "</li>"); | |
}); | |
} |
This file contains hidden or 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
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
This file contains hidden or 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
class GetHead | |
# Returns a Net::HTTPResponse. Get the status code (as string): | |
# resp = with_http "http://imaiku.me/" | |
# code = resp.code # => "301" | |
# resp.each {|k,v| puts k + "\t" + v} | |
def with_http url | |
uri = URI.parse url | |
http = Net::HTTP.start uri.host, uri.port | |
resp = http.head uri.path |