Skip to content

Instantly share code, notes, and snippets.

View jcspencer's full-sized avatar

James Spencer jcspencer

  • Australia
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcspencer
jcspencer / -
Created October 26, 2014 02:39
[13:38:37] James:hex git:(master*) $ mix hex
Hex v0.6.0
Registry file available (last updated: 2014-10-26 13:35:04)
Size: 166kB
Packages #: 272
Versions #: 968
Tasks:
@jcspencer
jcspencer / -
Created October 19, 2014 22:15
SELECT sum(heap_blks_hit) / (1 + sum(heap_blks_hit) + sum(heap_blks_read)) AS ratio FROM pg_statio_user_tables
set encoding=utf-8
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
@jcspencer
jcspencer / graph.js
Created January 3, 2014 00:12
Redis social graph in node.js, with following and blocking
var redis = require('redis').createClient(),
f = require('util').format;
Array.prototype.diff = function(a) { // use to remove blocked users
return this.filter(function(i) {return !(a.indexOf(i) > -1);});
};
var methods = {
follow: function(a, b, cb) {
db.sadd(f("node:%s:following", a), b, function(err, res){
wget http://bitnami.com/redirect/to/22096/bitnami-gitlab-5.4.0-0-linux-x64-installer.run && sudo chmod +x bitnami-gitlab-5.4.0-0-linux-x64-installer.run && sudo sh bitnami-gitlab-5.4.0-0-linux-x64-installer.run
@jcspencer
jcspencer / online
Created July 15, 2013 06:39
Check system internet connectivity. Add -m for minimal output. Add these files to your path and run online. :)
#!/bin/bash
node ~/.dotfiles/bin/online.js $@
@jcspencer
jcspencer / in_app.java
Last active December 10, 2015 13:18
Ouya Multiplayer API demo
//Create
OuyaLobby lobby = new OuyaLobby(max_players, port, region);
//Connect
OuyaLobby lobby = new OuyaLobby(host, port);
lobby.connect(new Callback() {
@Override
public void onMessage(JSONObject json, Acknowledge ack) {
try {
System.out.println("Server said:" + json.toString(2));