Skip to content

Instantly share code, notes, and snippets.

View jakl's full-sized avatar
💭
🦊

James Koval jakl

💭
🦊
View GitHub Profile
@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 / 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 / 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 / README.md
Last active December 22, 2015 06:09
Factory Girl in TTC
@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 / 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 / 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 / README.md
Last active December 23, 2015 00:49
Git Branch with Smart Directories

git-bd setup

mkdir workspace
cd workspace
git clone https://github.com/nnutter/git-bd.git
cd
mkdir bin
cd bin
@jakl
jakl / _cell.html.erb
Last active January 4, 2018 14:34
Rails Table Partial
<td width="<%= width %>">
<% if cell %>
<%= render partial: cell_partial, object: cell %>
<% end %>
</td>
@jakl
jakl / index.html
Created September 25, 2013 07:13
old jediset
Content-type: text/html
<title>JediSet</title><head><style type="text/css"> .bg { color: #00FF00; background: black; } </style></head><body class=bg><a href="http://github.com/jediknight304/jediset">JediSet Source at GitHub.com/Jediknight304</a><br /><pre>If looks like you aren't using any options, but options are kool
After your url which should end in .pl type a ? then any or all of these things
rows=7 or any number of columns you want besides 7
cards=81 81 is the maximum; more defaults back to 81
debug=4 numbers less than 4 will show less debug information
version=1 this is 1 or 0, and will show the current version of the program
help=1 this is also 1 or 0, and will show you a terminal manual page
listsets=1 show all sets (CHEATER)