Skip to content

Instantly share code, notes, and snippets.

@chrishokamp
chrishokamp / add_corns.js
Last active February 16, 2021 13:04
add some unicorns to your life -- paste this into console
var _loadScript = function(path, callback){ var script= document.createElement('script'); script.type= 'text/javascript'; script.src= path; document.head.appendChild(script); setTimeout(function() {callback();}, 5000); }; var draw = function() {var func = document.createElement('script'); func.type='text/javascript';var f='for (var i=20; i>0; i -= 1) { cornify_add(); }';func.innerText = f;document.head.appendChild(func);}; _loadScript('https://www.cornify.com/js/cornify.js', draw);
@chrishokamp
chrishokamp / 5_word2vec.ipynb
Created May 13, 2016 15:11
Example solution to Udacity Deep Learning course assignment 5 -- W2V CBOW
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrishokamp
chrishokamp / injecting $http in the console
Created December 11, 2013 00:24
how to inject $http into the console for an Angular app
var $inj = angular.injector(['App']);
var serv = $inj.get('$http');
var x = serv({method: 'POST', url: 'http://127.0.0.1:5000'}).success(function(data){console.log(data)}).error(function(data, status, header){ console.log(data); console.log(status); console.log(header);});
console.log(x);
@chrishokamp
chrishokamp / add_index_col.sh
Created October 17, 2013 11:17
add a numbered index column to a .csv using sed
sed = test_csv.csv | sed 'N;s/\n/,/'
@chrishokamp
chrishokamp / cut_cols.awk
Created October 15, 2013 15:53
simple awk to cut out some columns from a .csv
awk 'BEGIN{OFS=FS=","}
{print $2, $5 }
' "file.csv" > output.csv
@chrishokamp
chrishokamp / install_anaconda.sh
Last active October 11, 2015 18:40
install the anaconda scientific python distribution
# install the anaconda python distribution
echo 'grabbing the distro, note that you need to accept the license...'
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh
bash Anaconda*.sh
echo "all done, have a great day $USER"
@chrishokamp
chrishokamp / working_memorization_example.ipynb
Created August 6, 2015 16:12
dataset shape is everything!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrishokamp
chrishokamp / failed_memorization_example.ipynb
Created August 6, 2015 00:17
A toy example testing the ability (or lack thereof) of a vanilla RNN to memorize sequence information
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrishokamp
chrishokamp / wmt15_word_level_qe_evaluation.py
Created May 26, 2015 13:15
wmt15 word level quality estimation evaluation script
from __future__ import division, print_function
import codecs
from sklearn.metrics import f1_score
import numpy as np
from argparse import ArgumentParser
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
logger = logging.getLogger('wmt_eval_logger')
@chrishokamp
chrishokamp / hpt_rule_parse.ipynb
Created February 5, 2015 13:43
simple parsing of hpt rules into preauthoring autocomplete templates
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.