Skip to content

Instantly share code, notes, and snippets.

@cayuu
cayuu / tunnel.bash
Last active December 16, 2015 18:00
Working shell gist to `ssh` tunnel local port through server
ssh -p 22 -NT -g -R *:<toport>:127.0.0.1:<fromport> [email protected] -v
@cayuu
cayuu / getURLParam.js
Created July 9, 2013 04:05
URL parameter extraction function
function getURLParam( name ) {
return decodeURIComponent(
(new RegExp( '[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)' ).exec( location.search ) || [,""] )[1]
.replace(/\+/g, '%20'))
|| null;
}
@cayuu
cayuu / MuteRdioAds.js
Last active April 12, 2017 02:01
Mute Rdio Ads (copy + paste into browser console) [24 Oct 2013]
var r = R.player, oVol = r.volume(), tf = r._onTrackFinished, ar = r._onAudioReady, n = r._next;
r._onTrackFinished = function() {
return .001 !== r.volume() && (oVol = r.volume()), r.volume(.001), tf.apply(this, arguments);
};
r._onAudioReady = function() {
return r.playingAd() || r.volume(oVol), ar.apply(this, arguments);
};