Skip to content

Instantly share code, notes, and snippets.

@mrkmg
Last active December 6, 2015 23:00
Show Gist options
  • Save mrkmg/6e33f1c672818f30b312 to your computer and use it in GitHub Desktop.
Save mrkmg/6e33f1c672818f30b312 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name New Coffee-Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description shows how to use coffeescript compiler
// @author You
// @require http://coffeescript.org/extras/coffee-script.js
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @match https://speed.cd/browse.php*
// ==/UserScript==
/* jshint ignore:start */
var inline_src = (<><![CDATA[
watch_list = []
tick_interval = null
startUp = ->
onTick = ->
refreshResults = ->
$('').click()
askForWatch = ->
answer = prompt("Input a watch string")
if answer == ""
return
watch_list.push answer
askForWatch()
]]></>).toString();
var compiled = this.CoffeeScript.compile(inline_src);
eval(compiled);
/* jshint ignore:end */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment