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 bash | |
# Hacky script hacked together from the NixOS wiki, because NixOS doesn't actually sort out partitionting apparently. | |
set -euo pipefail | |
############### | |
# Setup partitions | |
parted /dev/sda -- mklabel gpt |
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 http = require("http"); | |
var express = require('express'); | |
var fs = require("fs"); | |
var app = express(); | |
var files = [ | |
[fs.readFileSync("./music/1.mp3"), 128 * 1024], | |
[fs.readFileSync("./music/2.mp3"), 64 * 1024], | |
]; |
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
(require 'dash) | |
(setq kColors '( :red :green :blue :cyan :orange :yellow)) | |
(defun make-random-color | |
(x) | |
"Picks a random color." | |
( nth (random ( length kColors) ) kColors )) | |
(defun make-sequence |
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
$(function(){ | |
ws = new WebSocket("ws://localhost:8080"); | |
ws.onmessage = function(evt) { | |
if ($('#chat tbody tr:first').length > 0){ | |
$('#chat tbody tr:first').before('<tr><td>' + evt.data + '</td></tr>'); | |
} else { | |
$('#chat tbody').append('<tr><td>' + evt.data + '</td></tr>'); | |
} | |
}; |