Skip to content

Instantly share code, notes, and snippets.

View saranrapjs's full-sized avatar

Jeff Sisson saranrapjs

View GitHub Profile
tell application "Safari"
make new document at end of documents
set URL of document 1 to "http://www.fitbit.com/"
do JavaScript "function myValue() {return 10;} myValue();" in document 1
display dialog the result
end tell
@saranrapjs
saranrapjs / 33rpm.js
Last active December 17, 2015 19:09
Bookmarklet for running <video> elements as if they were 45 RPM records playing at 33 RPM
var found = 0;
Array.prototype.slice.call(document.querySelectorAll('video')).forEach(function(me){ me.playbackRate = (33/45); found++; });
if (found === 0 && window.location.href.indexOf('www.youtube.com/watch?v=') !== -1) { // force HTML5 youtube
var id = window.location.href.substring(window.location.href.indexOf('watch?v=')+8);
if (id.indexOf('&') !== -1) id = id.substring(0, id.indexOf('&'));
if (confirm("To attempt to slow down this Youtube, we need to refresh the page, and then you can re-run this bookmarklet. Is this OK?")) {
window.location.href = 'http://www.youtube.com/watch_popup?v='+id;
}
}
@saranrapjs
saranrapjs / mongod.sh
Created March 5, 2013 14:41
homebrew mongod start
sudo mongod --config /usr/local/etc/mongod.conf --fork
@saranrapjs
saranrapjs / gitlatest.sh
Last active December 14, 2015 07:09
Point yer browser to your latest Git commit on Github.com. Add to your .gitconfig. I'm usen "open" which is Mac-specific syntax to open in browser (I believe?) With kudos to http://dropshado.ws/post/4964571254/git-remote-show-origin
LATEST=$(git rev-parse HEAD) && REMOTE=$(git remote show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/](.*\/.*)\.git/ && print $1') && FULL='https://github.com/'$REMOTE'/commit/'$LATEST && open $FULL
# added to your .gitconfig as an alias like so:
# [alias]
# point = !LATEST=$(git rev-parse HEAD);REMOTE=$(git remote show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/](.*\/.*)\.git/ && print $1');FULL="https://github.com/"$REMOTE"/commit/"$LATEST;open $FULL;
@saranrapjs
saranrapjs / clone.js
Created February 26, 2013 18:28
clone stories quickly
setInterval(function() { $(".item-clone:first").click() }, 1500);
@saranrapjs
saranrapjs / url.sh
Created February 11, 2013 17:04
local bonjour url
dns-sd -P Wordpress _http._tcp local 80 www.wordpress.local $(ipconfig getifaddr en1)
@saranrapjs
saranrapjs / gist:4747749
Created February 10, 2013 00:29
ffmpeg segmenting for HLS
ffmpeg -i "swipe_tabs.mp4" -map 0 -vbsf h264_mp4toannexb -f segment -segment_time 10 -segment_list test.m3u8 -segment_list_type flat -segment_format mpegts segment%d.ts
@saranrapjs
saranrapjs / jack.js
Created December 13, 2012 15:05
Used to add durations to Guthrie's JACK FM data
var echonest = require('echonest'),
myNest = new echonest.Echonest({
api_key: 'XXX'
}),
sqlite3 = require('sqlite3').verbose(),
db = new sqlite3.Database('jack.sql.db');
function getDuration(artist,title,callback) {
if (artist.indexOf(",") !== -1 && artist.split(",").length == 2) { // NORMALIZE LAST, FIRST ARTISTS
if (artist.indexOf("&") !== -1) {
@saranrapjs
saranrapjs / smooth-breeze-corpus.txt
Created September 30, 2012 13:50
Smooth Breeze Corpus
Conjures mesmerizing songs for dream adventures.
Desert heat with a jazz beat.
The intro kicks off the funk from beat one and it doesn't stop.
Taking a lively, introspective look at the places, experiences and people who have shaped his life. There's something for everyone; from classic funk to contemporary swing.
A specially priced collection featuring today's top smooth jazz artists and their most groovin' tracks.
Ive covered contemporary jazz guitarist Matt Marshak since 2009 when he released Family Funktion, a masterfully produced album that wore funk very well so well, in fact, that I drew a comparison between his own funky and blue style on that album to that of the jazz/blues guitar man Jeff Golub. The similarities were uncanny.
Marshaks follow-up album, Urban Folktales, wore smooth as well as anyone could wear it. Here on Colors of Me, his latest offering, the guitarist, focuses mostly on those blues and smooth elements more than funk. Here might be some of Marshaks bluesiest blues, jazziest jazz,
@saranrapjs
saranrapjs / wordpres_url_shift.sql
Created June 22, 2012 18:19
Change wordpress url manually
UPDATE wp_options SET option_value = replace(option_value, 'http://OLD_URL', 'http://NEW_URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://OLD_URL','http://NEW_URL');
UPDATE wp_posts SET post_content = replace(post_content, 'http://OLD_URL', 'http://NEW_URL');