This file contains 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
/** | |
* | |
* Base64 encode / decode module for node.js | |
* Uses URL-specifc base64 encoding | |
* Based on http://www.webtoolkit.info/ | |
* | |
**/ | |
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="; | |
// private method for UTF-8 encoding | |
var utf8_encode = function (string) { |
This file contains 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
// This snippet will prevent Grooveshark from pausing every 30 minutes, and tell it that you are alive, | |
// restoring the old Flash-player behaviour. | |
// Please note: This "alive" check is done only to non-VIP users, and may be a way of ensuring idle users | |
// don't waste server resources. Please only use if you are actually listening to Grooveshark, or purchase VIP | |
GS.lightbox.open_=GS.lightbox.open;GS.lightbox.open=function(a,b){if(a=='interactionTime'){GS.player.resumeSong();return}GS.lightbox.open_(a,b)} |
This file contains 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
/* | |
* Grooveshark HTML5 Audio Injector for Flash-less browsers | |
* <https://gist.github.com/gists/779895> | |
* Version 0.0.8 | |
* | |
* To use, simply copy and paste this code into the Developer Console | |
* for the open Grooveshark page and hit enter. Only tested with Google Chrome. | |
* | |
* Porting to Javascript Copyright (C) 2011 Adam Malcontenti-Wilson <[email protected]> | |
* All other elements Copyright (C) Escape Media Group ("Grooveshark") |
This file contains 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
// Run this on the YouTube page - either in developer tools or elsewhere | |
if (document.querySelector('a.yt-uix-button-menu-item[href="http://www.youtube.com/watch?v=dQw4w9WgXcQ"]')) { document.querySelector('a.yt-uix-button-menu-item[href="http://www.youtube.com/watch?v=dQw4w9WgXcQ"]').href = document.querySelector('video').src; } | |
// Note to YouTube: This stupid stunt just makes people angry - don't rickroll the users of your site. In fact, adding the link just helps the downloaders as extensions need much less work to add a context menu now, all they have to do is hook into your save video as link. |
This file contains 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
var MafiaWarsMobileFightBot = function() { | |
var fightUrl = 'mobileweb?xw_controller=fight&xw_action=view_mobile'; | |
var estimateStrengthWeights = {mafia: 1.5, level: 1.0}; | |
var strengthDifferenceThreshold = 0.15; | |
//TODO: add UI | |
//TODO: handle hospital case, if $('.hospital-block').length . heal-text and heal-button will describe action and cost | |
//TODO: implement lower end of strength threshold (e.g. don't fight too weak opponents) | |
function is_fights_page() { |
This file contains 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
/* | |
* main.c | |
* | |
* Created on: 11/03/2011 | |
* Author: adam | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <curl/curl.h> |
This file contains 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
/* FILE: error1.c | |
* Week 2 lab exercise 1 | |
* Author: Adam Malcontenti-Wilson <[email protected]> | |
* Last Modified <Wed Mar 9 10:57:24 EST 2011> | |
*/ | |
#include <stdio.h> | |
int main() | |
{ |
This file contains 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
/* FILE: tasks4.c | |
* Author: Adam Malcontenti-Wilson <[email protected]> | |
* Last Modified: 17/03/2011 12:20:00 PM | |
* | |
* Description: Printing hard-coded scores | |
* Inputs: none | |
* Outputs: Text in specifc format specified | |
*/ | |
#include <stdio.h> |
This file contains 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
# Usage: python tt2srt.py source.xml output.srt | |
from xml.dom.minidom import parse | |
import sys | |
i=1 | |
dom = parse(sys.argv[1]) | |
out = open(sys.argv[2], 'w') | |
body = dom.getElementsByTagName("body")[0] | |
paras = body.getElementsByTagName("p") | |
for para in paras: |
This file contains 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
/* Facebook Nyan Cat | |
* Works only in Webkit browsers | |
* Uses images + sound from http://nyan.cat | |
*/ | |
var NyanCat = (function NyanCatFacebook() { | |
const updateInterval = 10; | |
var nyan, rainbows, sound; | |
var loadingPosts = false; | |
var top = 0; | |
var interval = null; |
OlderNewer