Skip to content

Instantly share code, notes, and snippets.

View nderscore's full-sized avatar
👉
😎 👉

_nderscore nderscore

👉
😎 👉
View GitHub Profile
@nderscore
nderscore / ttRandom.js
Last active December 18, 2015 07:19
Bookmarklet. Random track puller for turntable.fm
javascript:(function(){var num=prompt("Pull up how many random tracks?",1);if(isNaN(num)||+num<1)return alert('Not a valid number.');while(num--){setTimeout(function(){var i=Math.floor(Math.random()*turntable.playlist.fileids.length);turntable.playlist.reorder(i,0);turntable.playlist.queue.reorder(i,0);},500*num);}})();
/* _nderscore/turntable.fm */
@nderscore
nderscore / ttMute.js
Last active December 18, 2015 07:19
Bookmarklet. Mutes turntable.fm temporarily until the next song starts.
javascript:(function(){var orig=httpStream.volume;httpStream.setVolume(0);var listener=function(_){if( _.command&&_.command=='newsong'){turntable.removeEventListener('message',listener);httpStream.setVolume(orig);}};turntable.addEventListener('message',listener);})();
/* _nderscore/turntable.fm */
@nderscore
nderscore / ttTags.js
Last active December 18, 2015 07:19
Bookmarklet. Displays all available metadata for the currently playing track on turntable.fm. Track tags are output to the chat area and only visible to you.
javascript:(function(){for(var x in turntable){if(turntable[x]!=null&&turntable[x].hasOwnProperty('numDjs')){var s=turntable[x].currentSong.metadata,e=document.createElement("div");e.className="message";e.innerHTML="<b>Artist:</b> "+s.artist+"<br /><b>Album:</b> "+s.album+"<br /><b>Song:</b> "+s.song+"<br /><b>Genre:</b> "+s.genre+"<br /><b>Length:</b> "+Math.floor(s.length/60)+"m"+(s.length%60)+"s";var m=document.getElementsByClassName("messages")[0];m.appendChild(e);m.scrollTop+=999;}}})();
/* _nderscore/turntable.fm */
@nderscore
nderscore / ttExportQueue.js
Last active December 18, 2015 07:19
Bookmarklet. Displays a textbox containing every track in your current playlist queue on turntable.fm. Format for tracks is Artist - [Album] Title.
javascript:(function(){var ids=turntable.playlist.fileids,tracks=turntable.playlist.songsByFid,output=[],meta={},item="";for(var i in ids){meta=tracks[ids[i]].metadata;item =meta.artist+" - "+meta.song;if(meta['album'])item+=" [ "+meta.album+" ]";output.push(item);}output.sort();var o=$('<textarea style="width:640px;height:480px;"></textarea>').text(output.join('\n'));var d=$('<div id="qqq" style="position:absolute;top:0;left:0;z-index:99999;"><a href="javascript:$(\'#qqq\').remove();" style="background:#000;color:#fff;">[close]</a></div>');d.prepend(o);$('body').append(d);})();
/* _nderscore/turntable.fm */
@nderscore
nderscore / ttDeafnessCure.js
Last active December 18, 2015 07:19
Bookmarklet. Prevents deafness for lonely DJ's on turntable.fm
javascript:(function(){for(var x in turntable){if(turntable[x]!=null&&turntable[x].hasOwnProperty('numDjs')&&!turntable[x].hasOwnProperty('numDjsClone')){turntable[x]['numDjsClone']=turntable[x]['numDjs'];turntable[x]['numDjs']=function(){if(this.numDjsClone()==1)return 0;return this.numDjsClone();};alert("Deafness cure applied successfully! :)");}}})();
/* _nderscore/turntable.fm */
@nderscore
nderscore / ttSongLog.js
Last active December 20, 2015 05:59
Bookmarklet. Creates a log of all songs played in a room. Run the bookmark once to start logging, and run it again later on to pull up the log. The bookmark will also pull the recently played tracks list.
javascript:(function(){if(window.ttLOG){var e=[];ttLOG.forEach(function(t){var n=t.song;e.push("[DJ: "+t.dj+" ] "+n.artist+" - "+n.song+(n.album?" [ "+n.album+" ]":""))});var t=$('<textarea style="width:640px;height:480px;"></textarea>').text(e.join("\n"));var n=$('<div id="qqq" style="position:absolute;top:0;left:0;z-index:99999;"><a href="javascript:$(\'#qqq\').remove();" style="background:#000;color:#fff;">[close]</a></div>');n.prepend(t);$("body").append(n)}else{ttLOG=[];(function(){for(i in turntable)if(turntable[i]&&turntable[i].roomId)return turntable[i]})().roomData.metadata.songlog.forEach(function(e){ttLOG.push({dj:e.djname,song:e.metadata})});turntable.addEventListener("message",function(e){if(!e.command||e.command!="newsong")return;var t=e.room.metadata.current_song;ttLOG.push({dj:t.djname,song:t.metadata})});alert("Started Logging. Run bookmark again to view the log.")}})()
@nderscore
nderscore / ichc_popout.js
Last active December 22, 2015 04:39
Popout Chat Bookmarklet for ICHC
javascript:(function(){$.getScript('http://nderscore.com/_stuff/popout.js');})();
if (window.speechSynthesis && console.log.name !== 'talkLog') {
console.log = (log => function talkLog(){
[...arguments].forEach(item => {
if (typeof item !== 'string') {
try {
item = `Object: ${JSON.stringify(item)}`;
} catch (e) {
item = '';
}
}
@nderscore
nderscore / tetris_attack_netplay.md
Last active November 27, 2022 14:50
Guide for configuring Retroarch with Snes9x Core for Tetris Attack netplay.

Tetris Attack

Tetris Attack Netplay Guide

Guide for configuring Retroarch with Snes9x Core for Tetris Attack netplay.

Last updated: 2017.08.13 by _nderscore

@nderscore
nderscore / TamaguiSolitoTextLink.tsx
Last active October 21, 2023 17:45
Example Tamagui Solito Text Link