Skip to content

Instantly share code, notes, and snippets.

//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js
//
@reecer
reecer / GNOME disable static dual monitor
Created March 15, 2014 22:14
When switching between workspaces, the secondary monitor will switch as well.
gsettings set org.gnome.shell.overrides workspaces-only-on-primary false
@reecer
reecer / user.sublime-keymap
Created April 2, 2014 22:27
Sublime Text multiple cursor key binding
[
{ "keys": ["alt+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["alt+down"], "command": "select_lines", "args": {"forward": true} },
]
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
@reecer
reecer / install.sh
Created April 14, 2014 19:10
Installing emscripten
# Note: The last two instructions are Ubuntu-specific. Most distros carry these packages, though.
# 1. Get source
git clone git://github.com/kripken/emscripten.git
# 2. Get LLVM-CLANG -- probably available in apt-get
wget http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz
tar -zxvf clang...
@reecer
reecer / General Makefile
Last active November 28, 2022 19:28
A general makefile for general-purpose C projects.
CC=gcc
CCFLAGS=-Wall
LDFLAGS=
SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:.c=.o)
TARGET=des
all: $(TARGET)
$(TARGET): $(OBJECTS)
@reecer
reecer / CodeMirror.dart
Created July 17, 2014 07:26
Simple js-interop with dart to wrap an instance of CodeMirror.
import 'dart:html';
import 'dart:js';
class CodeMirror{
var cm;
CodeMirror(Element el){
cm = context.callMethod("CodeMirror", [el]);
}
}
import websocket
import thread
import time
import sys
from urllib import *
class SocketIO:
def __init__(self):
self.PORT = 5000
self.HOSTNAME = '127.0.0.1'
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
@reecer
reecer / sineWave.js
Created August 22, 2014 06:42
Sine wave using canvas.
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var points = {};
var x = 0;
var len = 500;
animate();