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
window.App = {} | |
get_template = (el, tpl, callback, context = {}) -> | |
$(el).html(_.template("hello", context)); | |
callback(); | |
class App.IndexView extends Backbone.View | |
template: "index" | |
el: $("#container") |
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
#!/bin/bash | |
# git.sh - Interactive Git Shell | |
# store command history here | |
HISTFILE=~/.gitsh_history | |
control_c() { | |
# save history before exiting | |
history -a | |
# i can't figure out how to make this just break out of the read command |
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
SELECT | |
musicbrainz.release_group.gid AS release_mbid, | |
musicbrainz.release_group.type AS primary_type, | |
musicbrainz.release_group_secondary_type_join.secondary_type AS secondary_type, | |
musicbrainz.release_name.name AS release_name | |
FROM | |
musicbrainz.artist | |
INNER JOIN musicbrainz.artist_credit_name | |
ON musicbrainz.artist_credit_name.artist = musicbrainz.artist.id |
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
SELECT | |
musicbrainz.release.gid AS release_mbid, | |
musicbrainz.release_meta.amazon_asin AS asin, | |
musicbrainz.release_meta.cover_art_presence AS art | |
FROM | |
musicbrainz.release_group | |
INNER JOIN musicbrainz.release | |
ON musicbrainz.release.release_group = musicbrainz.release_group.id |
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
#include <pthread.h> | |
#include <stdio.h> | |
void count() { | |
int i = 0; | |
for(i = 0; i < 10; i++) { | |
usleep(1); | |
printf("Counting: %d\n", i); | |
} | |
} |
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
diff --git a/static/application.js b/static/application.js | |
index b4dc334..e83086b 100644 | |
--- a/static/application.js | |
+++ b/static/application.js | |
@@ -116,16 +116,21 @@ function RoomCtrl($scope, $routeParams, groove, localStorageService) { | |
$scope.tracks = groove.playlists[groove.activePlaylist]; | |
$scope.files = []; | |
$scope.tempGravatarEmail = groove.me.gravatar; | |
- | |
$scope.currentTrack = null; |
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 WebSocketServer = require('websocket').server; | |
var http = require('http'); | |
var WebsocketExporter = function(stat_manager) { | |
var self = this; | |
self.stat_manager = stat_manager; | |
self.connections = []; | |
self.server = http.createServer(self.handleServerRequest); | |
self.server.listen(8080); |
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
#!/usr/bin/env coffee | |
# install dependencies: npm install irc | |
irc = require 'irc' | |
server = 'hubbard.freenode.net' | |
nickServPassword = '' | |
nick = 'bongbot' | |
client = new irc.Client server, 'bongbot', |
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 MongoClient = require("mongodb").MongoClient; | |
MongoClient.connect(process.env.MONGO_URI, function(err, db) { | |
var users = db.collection("users"); | |
var places = db.collection("places"); | |
var one_done = 0; | |
function checkDone() { | |
if(one_done == 3) { | |
db.close(); |
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 EventEmitter = require('events').EventEmitter; | |
var redis = require("redis"); | |
var StatManager = function() { | |
var self = this; | |
self._data_handlers = []; | |
self._listeners = {}; | |
self.stats = {}; | |
self.aggregate_interval = undefined; | |
self.redis = redis.createClient(); |
OlderNewer