Skip to content

Instantly share code, notes, and snippets.

View dirkk0's full-sized avatar

Dirk Krause dirkk0

View GitHub Profile
@dirkk0
dirkk0 / gist:4530915
Last active December 11, 2015 02:29
Installing Telescope ( https://github.com/SachaG/Telescope)
# https://github.com/SachaG/Telescope
########################
# it should be
sudo apt-get install git npm
curl https://install.meteor.com | /bin/sh
sudo npm install -g meteorite
""""Create "The Matrix" of binary numbers scrolling vertically in your terminal.
original code adapted from juancarlospaco:
- http://ubuntuforums.org/showpost.php?p=10306676
Inspired by the movie: The Matrix
- Corey Goldberg (2013)
Requires:
@dirkk0
dirkk0 / index.html
Created January 18, 2013 16:13
drag a box on multiple browsers in realtime with websockets. Most of the code is from this thread: http://stackoverflow.com/questions/9865167/socket-io-and-complex-json-with-node-js-jquery (I changed the mousemove to drag, though)
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
$(document).ready(function () {
var socket = io.connect();
socket.on('update_position', function (data) {
@dirkk0
dirkk0 / install.sh
Created January 22, 2013 08:02
Installation of BLK (https://github.com/benvanik/blk-game) on Amazon EC2(Ubuntu
# install newer node
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
sudo apt-get install --yes build-essential;
sudo apt-get install curl screen
@dirkk0
dirkk0 / tasks.py
Created January 23, 2013 06:34
process tasks from taskwarrior in python (via http://taskwarrior.org/boards/1/topics/2397 wanted to post this but can't login)
# on the shell, do:
# task rc.json.array=yes export > del.json
import json
tasks = json.load(open('del.json', 'r'))
for task in tasks:
print task["uuid"]
print task["description"]
# this doesn't work yet
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
sudo apt-get install git screen
git clone git://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git
cd org.eclipse.orion.client/modules/orionode
@dirkk0
dirkk0 / list.py
Created June 27, 2013 10:29
Python scripts to register a OAuth1 client with pump.io, to list your status updates and to post an note. Heavily inspired PyPump; Kudos to https://github.com/xray7224/PyPump. To use it run register.py first.
# Thanks to # https://github.com/xray7224/PyPump
#
import json
import sys
import requests
from requests_oauthlib import OAuth1
try:
@dirkk0
dirkk0 / doit.sh
Created July 9, 2013 13:55
Install pump.io on Amazon EC2
sudo apt-get update
# get ec2 ip and hostname
curl http://169.254.169.254/latest/meta-data/public-ipv4 > public.ip
curl http://169.254.169.254/latest/meta-data/public-hostname > public.hostname
sudo apt-get install --yes build-essential curl git
#install latest node
sudo apt-get install --yes python-software-properties python g++ make
sudo add-apt-repository --yes ppa:chris-lea/node.js
sudo apt-get update
@dirkk0
dirkk0 / test.js
Created July 10, 2013 10:20
very simple express app. used to file a bug with cloud9.
var express = require('express'),
app = express();
app.use(express.bodyParser());
app.use(express.logger());
app.get('/', function(req, res){
res.send('Hello World');
});
@dirkk0
dirkk0 / gist:5967221
Created July 10, 2013 15:24
Enabling CORS in Angular JS with NodeJS/Express
// in AngularJS (client)
myApp.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);
// in Express/nodeJS