Skip to content

Instantly share code, notes, and snippets.

@BenjaminRH
BenjaminRH / jonathancoulton.sh
Created January 25, 2012 13:44 — forked from robolson/jonathancoulton.sh
Bash script to download all of Jonathan Coulton's free songs.
#!/bin/sh
# Downloads all of Jonathan Coulton's free songs
# from http://www.jonathancoulton.com/store/downloads/
curl -C - "http://songs.jonathancoulton.com/free/mp3/Washy%20Ad%20Jeffy.mp3" -o "Washy Ad Jeffy.mp3" \
"http://songs.jonathancoulton.com/free/mp3/SkyMall.mp3" -o "SkyMall.mp3" \
"http://songs.jonathancoulton.com/free/mp3/Creepy%20Doll.mp3" -o "Creepy Doll.mp3" \
"http://songs.jonathancoulton.com/free/mp3/Big%20Bad%20World%20One.mp3" -o "Big Bad World One.mp3" \
"http://songs.jonathancoulton.com/free/mp3/Mr.%20Fancy%20Pants.mp3" -o "Mr. Fancy Pants.mp3" \
"http://songs.jonathancoulton.com/free/mp3/I'm%20Your%20Moon.mp3" -o "I'm Your Moon.mp3" \
// in routes.js
function redirectWhenLoggedIn(context) {
var user = Meteor.user();
if (user && !Meteor.loggingIn()) {
context.redirect('/dashboard');
}
}
<head>
<title>Cinder</title>
</head>
<body>
{{#isolate}}
{{renderPage}}
{{/isolate}}
{{!>logs_bootstrap}}
</body>
// Client
Meteor.subscribe('todos');
if (Meteor.isClient) {
function updateHTML(elmId, value) {
document.getElementById(elmId).innerHTML = value;
}
// This function is called when an error is thrown by the player
function onPlayerError(errorCode) {
alert("An error occured of type:" + errorCode);
}
<head>
<title>Title</title>
<meta charset="utf-8">
<meta name="robots" content="all">
</head>
<body>
{{> nav_header}}
{{> index}}
</body>
client.addListener('PING', function() {
Fiber(function() {
client.send('PONG');
}).run();
});
Template.admin.events =
"click #createPost": () ->
Meteor.render(() ->
"{{> create_news_post}}"
)
@BenjaminRH
BenjaminRH / queue.coffee
Last active December 21, 2015 14:18 — forked from svasva/queue.coffee
@Queue = new Meteor.Collection 'queue'
Meteor.startup ->
Meteor._processQueue = ->
if Meteor._queueProcessing ||= false
Meteor.setTimeout Meteor._processQueue, 100
return
Meteor._queueProcessing = true
qsize = Meteor._queue.length
qdone = 0
Meteor.Router.add({
'/': {
to: 'index',
and: function () {
Session.set('genre', null);
}
}, // site index
'/:action/:action2/:action3': function (action, action2, action3) {
var genreSession = null,