Skip to content

Instantly share code, notes, and snippets.

View jakl's full-sized avatar
💭
🦊

James Koval jakl

💭
🦊
View GitHub Profile
@jakl
jakl / README.md
Created September 11, 2013 02:51
Bitcoin Mining in Ubuntu

Bitcoin Mining in Ubuntu

Get a Wallet

Coinbase has the best wallets around! Please use this link cause I get $5 referal bonus.

Locate a mine

@jakl
jakl / index.java
Created September 8, 2013 06:47
ai stuff
//constructs a naive Bayes binary classifier
public NaiveBayes(double in[][], boolean out[]){
int inputs = in[0].length ;
//initialize sums and sums of squares for each class
double[] poss = new double[inputs], poss2 = new double[inputs];
double[] negs = new double[inputs], negs2 = new double[inputs];
//calculate amount of each class, sums, and sums of squares
for(int k=0;k<in.length;k++){//for each data point
if(out[k]){
positives++;//keep track of total positives
@jakl
jakl / index.rb
Created September 6, 2013 22:12
Silly little code practice from last week
#!/usr/bin/env ruby
# Find the index(es) in an array of integers where sums above and below are equal
def solution(a)
sum = a.reduce(:+)
return -1 unless sum
return 0 if sum - a[0] == 0
@jakl
jakl / README.md
Last active December 22, 2015 06:09
Factory Girl in TTC
@jakl
jakl / fix_whitespace.bash
Last active December 22, 2015 06:09
Remove trailing whitespace and convert tabs to 2 spaces
# Warning: Operates on binary files - make sure to have all files in git to revert them!
# remove trailing whitespace recursively in a repo
find . -type f -not -iwholename '*.git*' | xargs sed -i -r 's/[ ]+$//' # [] contains a space and a tab
# convert tabs to spaces:
find . -type f -not -iwholename '*.git*' | xargs sed -i -r 's/ / /g' # s/1/2/g ... 1 is a tab, 2 is two spaces
# revert binary files
git diff | grep Binary | sed 's/^Binary files a\///' | sed 's/ and .*$//' | xargs git checkout
@jakl
jakl / index.js
Created July 21, 2013 09:15
requirebin sketch
var twtxt = require('twitter-text')
// Input / output user facing elements
var explanation = document.createElement('div')
var input = document.createElement('input')
var output = document.createElement('div')
document.body.appendChild(explanation)
document.body.appendChild(input)
document.body.appendChild(output)
@jakl
jakl / index.js
Last active December 19, 2015 14:39 — forked from max-mapper/index.js
requirebin sketch
var twtxt = require('twitter-text')
// Input / output user facing elements
var explanation = document.createElement('div')
var input = document.createElement('input')
var output = document.createElement('div')
document.body.appendChild(explanation)
document.body.appendChild(input)
document.body.appendChild(output)
@jakl
jakl / head.html
Created July 10, 2013 19:27 — forked from juliangruber/head.html
requirebin sketch
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style>
@jakl
jakl / index.js
Created July 10, 2013 19:12
requirebin sketch
// require something
require('twitter-text')
@jakl
jakl / hashy.coffee
Last active December 19, 2015 03:19
hashcat and john don't support dictionary words with newlines?
#!/usr/bin/env coffee
argf = new (require './argf.js')()
md5 = require 'md5'
HASH = '12345678123456781234567812345678'
argf.forEach (line)->
if md5.digest_s(line.replace('\\n', '\n')) is HASH
console.log line