Skip to content

Instantly share code, notes, and snippets.

@bhelx
bhelx / books.md
Last active December 21, 2015 17:08
Trying to reduce my library. Most of these books I got in college. My plan is to give them away.

Java (some textbooks)

  • Java: The Good Parts
  • Java: Concurrency in Practice (feat. Paul Christmann)
  • Java Generics and Collections
  • Java Web Services Up and Running
  • Data structures and other Objects using java
  • Spring MVC and Web Flow
  • Big java (second edition)
  • Effective Java (good java book)
@bhelx
bhelx / chrubuntu.md
Last active December 14, 2015 02:09
Samsung Chrubuntu
var NickList = function () {
this.nicks = [];
this.colorMap = {};
this.colors = [
'#ff00ff',
'#00007f',
'#009300',
'#ff0000',
'#7f0000',
'#9c009c',
@bhelx
bhelx / trace.js
Last active December 11, 2015 04:29
This is an incomplete thought. Doesn't actually show enough information to do anything useful.
/**
* Intelligent Traceroute
*
* Do a traceroute on a domain, prints a json array
* of the hops with their physical locations.
*
* //Example
* node trace.js google.com
*
* npm install traceroute async underscore request
@bhelx
bhelx / face_extractor.py
Last active December 10, 2015 09:39
Recursively walk given directory, find faces in jpegs, extract the sub images into their own images for training set
#!/usr/bin/python
import cv
import time
import Image
import fnmatch
import os
import sys
def DetectFace(image, faceCascade):
/**
* A little code from Collective Intelligence translated to javascript
*/
var critics = {
"Lisa Rose": {
"Lady in the Water" : 2.5
, "Snakes on a Plane" : 3.5
, "Just My Luck" : 3.0
, "Superman Returns" : 3.5
@bhelx
bhelx / test.js
Created November 25, 2012 20:21
Non _id document reference
var mongoose = require('mongoose');
var db = mongoose.createConnection('localhost', 'test');
var UserSchema = mongoose.Schema({
name: String,
phone: Number
});
var MemorySchema = mongoose.Schema({
user: { type: Number, ref: 'User' },
@bhelx
bhelx / hacked_bone.js
Created November 8, 2012 20:34
hacked Backbone model
/** WTF MAYNE **/
Admin.User = Backbone.Model.extend({
idAttribute: '_id',
setAction: function (action) {
this.action = action;
},
getAction: function () {
if (!this.action) return '';
var action = this.action;
this.action = null;
@bhelx
bhelx / vim.rb
Created October 27, 2012 07:21
vim update
require 'formula'
class Vim < Formula
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :revision => '57e8b75298d6'
version '7.3.712'
homepage 'http://www.vim.org/'
head 'https://vim.googlecode.com/hg/'
@bhelx
bhelx / dump.js
Created September 24, 2012 22:57
body dump middleware
app.all('*', function (req, res, next) {
req.setEncoding('utf-8');
req.on('data', function (data) {
console.log(data);
});
// next();
});