Skip to content

Instantly share code, notes, and snippets.

View traviskaufman's full-sized avatar

Travis Kaufman traviskaufman

View GitHub Profile
@traviskaufman
traviskaufman / protobuf_2_6_0_ubuntu_install.sh
Created December 29, 2014 18:33
Shell Script to Compile and Install protobuf v2.6.0 on Ubuntu
# Installs protobuf 2.6.0 on Ubuntu (currently not a deb package ugh)
protodir=protobuf-2.6.0
filename="$(protodir).tar.gz"
known_md5=9959d86087e64524d7f91e7a5a6e4fd7
builddir="$(mktemp -d $TMPDIR/protobuild.XXXXXX)"
if [ ! -d $builddir ]; then
echo "$0: Can't create temp build dir! WTF??!"
exit 1
@traviskaufman
traviskaufman / hapi-i18n.js
Created February 12, 2015 03:33
Minimal i18n plugin for HapiJS using node-i18n
'use strict';
import _ from 'lodash';
import i18n from 'i18n';
import {version} from '../../package.json';
registerI18n.attributes = { name: 'i18n', version };
export default registerI18n;
@traviskaufman
traviskaufman / group-rename-yosemite-translation.md
Created May 2, 2015 13:41
(Translation) How to Easily Rename a Group of File on OS X Yosemite

This is an english translation of http://www.guideitech.com/apple/come-rinominare-facilmente-un-gruppo-di-file-su-os-x-yosemite/ While I translated it mostly to practice my Italian, it's a great article and shows a cool feature on Yosemite if you don't want to deal with doing this at the command line :) Also please let me know if you find any mistakes or bad translations!

How to rename a group of files on OS X Yosemite

I’m sure there are hundreds of unorganized files on your macs right this moment. Vacation photos, PDF documents, downloads, TV series, or whatever. The first step in organizing these contents is to give them proper names.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@traviskaufman
traviskaufman / ReverseBinary.java
Created February 21, 2013 23:33
My Solution to Spotify's [Reversed Binary Numbers](https://www.spotify.com/us/jobs/tech/reversed-binary/) problem that's apparently wrong for reasons unknown to me. -_-
import java.util.Scanner;
/**
* Class that contains logic to reverse the bits of an integer and spit it
* back out.
*/
public class ReverseBinary {
/**
* Reverse the bits of an integer between 1 ≤ n ≤ 1000000000.
@traviskaufman
traviskaufman / cats_vs_dogs.py
Last active December 14, 2015 04:19
My best go at Spotify's Heavy Metal question.
"""
I apologize this isn't more well-documented :/
"""
#!/usr/bin/env python
"""
Plays the game of cat vs. dog
"""
from sys import stdin
@traviskaufman
traviskaufman / index.html
Last active August 10, 2016 21:14
(Probably Bad) MDL v2 Ripple Prototype (alpha.2)
<section>
<button type="button" class="btn">A Thing</button>
<button type="button">Something else that can be focused</button>
</section>
@traviskaufman
traviskaufman / tips-for-coming-to-rust-from-javascript.md
Last active September 12, 2016 03:50
Tips for Coming to Rust from Javascript (WIP)

The following are tips I put together which I would have found helpful after coming to rust from Javascript.

NOTE: If you've never used a statically-typed programming language before, I highly recommend checking out Liz Baille's illustrated survival guide presentation from RustConf 2016.

I've been using Javascript both personally and professionally as my primary language. In many cases, even exclusively. However, I actually got my start in systems programming, writing really bad C code for MaxMSP, and it therefore has a special place in my heart.

Rust is like C, but way better. The rust team has essentially taken the complexity of designing a high-level language runtime and pushed it down the compiler. This is insanely impressive, and produces ridiculously incredible results. This is systems programming language with things like traits, generics, very intelligent type inference,

@traviskaufman
traviskaufman / MLPMnistSingleLayerExample.scala
Created October 25, 2016 01:54
dl4j's MLPMnistSingleLayerExample in Scala
/**
* @see https://github.com/deeplearning4j/dl4j-examples/blob/master/dl4j-examples/src/main/java/org/deeplearning4j/examples/feedforward/mnist/MLPMnistSingleLayerExample.java
*/
import scala.collection.JavaConversions._
import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator
import org.deeplearning4j.eval.Evaluation
import org.deeplearning4j.nn.api.OptimizationAlgorithm
import org.deeplearning4j.nn.conf.NeuralNetConfiguration
@traviskaufman
traviskaufman / fe_techinterviewq.md
Last active November 1, 2016 20:09
Comprehensive Front-End Technical Interview Question

###Comprehensive Technical Interview Question

Consider the following javascript module:

/**
 * A module for tracking when a user visits the page.
 */
window.VisitingDateTracker = {
  /**
 * Initialize the tracker.