Skip to content

Instantly share code, notes, and snippets.

View MeoMix's full-sized avatar

Sean Anderson MeoMix

  • San Francisco, CA
View GitHub Profile
.bootstrap .multiselect-container {
position: absolute;
list-style-type: none;
margin: 0;
padding: 0;
}
.bootstrap .multiselect-container .input-group {
margin: 5px;
}
.bootstrap .multiselect-container > li {
_.mixin({
// Inspired by: https://gist.github.com/danro/7846358
// Leverage requestAnimationFrame for throttling function calls instead of setTimeout for better perf.
throttleFramerate: function(callback) {
var wait = false;
var args = null;
var context = null;
return function() {
if (!wait) {
Koyaanisqatsi Movie Full Soundtrack - Phillip Glass (1982),t-t8w08QNJM
Halo 4 OST - Beauty of Cortana,C585gsBarW8
Games of Thrones - House Stark Theme,SZrDEUldGr0
Owl City Rainbow Veins,2EsMHFXdLxI
Basil Poledouris - Riddle Of Steel / Riders Of Doom,onGWF8mz1Zw
Trans-Siberian Orchestra: Christmas Dreams,KrvGklFCb6c
Theophany - Time's End - Majora's Mask Remixed,F4jdLygR-dI
Stabilised Zelda: Symphony of the Goddesses- London 2013,VujV19LQh24
Passenger - Let Her Go [Official Video],RBumgq5yVrA
Wayne County | Storm the gates of heaven | 01. Storm the gates of heaven,79fk08Ax774
;Column1:
;MouseClick("left", 420, 365, 1, 1);Smoke err day!
;MouseClick("left", 420, 440, 1, 1)
;MouseClick("left", 420, 555, 1, 1)
;MouseClick("left", 420, 650, 1, 1)
;Column2:
;MouseClick("left", 550, 365, 1, 1)
;MouseClick("left", 550, 440, 1, 1)
;MouseClick("left", 550, 555, 1, 1)
var updateSoundIcon = function(volume){
//Repaint the amount of white filled in the bar showing the distance the grabber has been dragged.
var backgroundImage = '-webkit-gradient(linear,left top, right top, from(#ccc), color-stop('+ volume/100 +',#ccc), color-stop('+ volume/100+',rgba(0,0,0,0)), to(rgba(0,0,0,0)))';
volumeSlider.css('background-image', backgroundImage);
var active = '#fff';
var inactive = '#555';
//Paint the various bars indicating the sound level.
var fillColor = volume >= 25 ? active : inactive;
//Randomizes the playlist and then saves it.
shuffle: function () {
var i, j, t;
for (i = 1; i < playlist.songs.length; i++) {
j = Math.floor(Math.random() * (1 + i)); // choose j in [0..i]
if (j !== i) {
t = playlist.songs[i]; // swap songs[i] and songs[j]
playlist.songs[i] = playlist.songs[j];
playlist.songs[j] = t;
}
playableVideos.sort(function(a,b){
return levDist(a.title, text) - levDist(b.title, text);
});
var levDist = function(s, t) {
var d = []; //2d matrix
// Step 1
var n = s.length;
var m = t.length;
//JAVASCRIPT! The wonderful world where you can't do this:
chrome.storage.sync.set({playlist.id: JSON.stringify(playlist)});
//BUT! You can do this!
var keyValuePair = {};
keyValuePair[playlist.id] = JSON.stringify(playlist);
chrome.storgae.sync.set(keyValuePair);
var onReady = function(){
var waitForPlaylistAndPort = setInterval(function(){
playlist = playlists.getSelectedPlaylist();
if(playlist && port){
clearInterval(waitForPlaylistAndPort);
sendUpdate();
//If there is a song to cue might as well have it ready to go.
for (var i = 0; i < songs.length; i++){
//Wrap in a closure to preserve song index for each iteration.
//If you don't do this the contextmenu method will always have the last song.
(function(i){
var listItem = $('<li/>').appendTo(songList);
var song = songs[i];
var link = $('<a/>', {