Skip to content

Instantly share code, notes, and snippets.

View sdwfrost's full-sized avatar

Simon Frost sdwfrost

View GitHub Profile
@sdwfrost
sdwfrost / README.md
Created May 31, 2016 10:35 — forked from thequux/README.md
Multirust-compatible racer wrapper

This wrapper automatically sets the RUST_SRC_DIRECTORY environment variable for whatever rust compiler is currently active, automatically creating a new checkout whenever necessary. This should be compatible with all of the multirust-alike tools, but it has only been tested with rustup.rs

Installation

Simply place this somewhere on your path before the main racer binary and set the execute bit.

Uninstallation

@sdwfrost
sdwfrost / forms.html
Created September 20, 2016 05:18 — forked from gnunicorn/forms.html
Jinja2 WTForms macros for twitter bootstrap
{%- macro form_field_label(field) -%}
<label for="{{ field.id }}">{{ field.label.text }}
{%- if field.flags.required -%}
<abbr title="Diese Feld muss angegeben werden">*</abbr>
{%- endif %}</label>
{% endmacro %}
{%- macro form_field_description(field) -%}
{% if field.description %}
<span class="descr">{{ field.description }}</span>
@sdwfrost
sdwfrost / pi_qemu.sh
Created November 24, 2016 12:34 — forked from JasonGhent/pi_qemu.sh
OSX raspberry pi emulation via QEMU. v2 attempt @ https://gist.github.com/JasonGhent/922f38f57c8cb77b10f3
# pulled from http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
# expanded via http://superuser.com/questions/690060/how-to-enable-network-with-a-raspberry-pi-emulated-on-qemu
# tested with 2015-02-16-raspbian-wheezy.zip on OSX Mavericks
# OSX terminal
brew install qemu
# kernel-qemu is a linux kernel compiled with ARM1176 support.
# learn more here: http://xecdesign.com/compiling-a-kernel/
curl -OL http://xecdesign.com/downloads/linux-qemu/kernel-qemu
curl -o raspbian_latest.zip -L http://downloads.raspberrypi.org/raspbian_latest
@sdwfrost
sdwfrost / mingw-w64-3.10-osx10.9.sh
Created November 26, 2016 13:49 — forked from Drakulix/mingw-w64-3.10-osx10.9.sh
Script to install a Mingw-w64 Cross-Compiler Suite on Mac OS X 10.9
#!/bin/sh
# dependencies
echo "Installing dependencies via Homebrew (http://brew.sh)"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew install gcc48
@sdwfrost
sdwfrost / git_create_orphan.sh
Created November 28, 2016 10:13 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@sdwfrost
sdwfrost / neighbor-joining-experiments.ipynb
Created January 20, 2017 13:32 — forked from gregcaporaso/neighbor-joining-experiments.ipynb
initial experiments with implementing neighbor joining for scikit-bio
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@sdwfrost
sdwfrost / batch-lstm.R
Created May 17, 2017 11:53 — forked from georgeblck/batch-lstm.R
An efficient, batched LSTM in R
###
### This is a batched LSTM forward and backward pass. Written by Andrej Karpathy (@karpathy)
### BSD License
### Re-written in R by @georgeblck
###
rm(list=ls(all=TRUE))
LSTM.init <- function(input_size, hidden_size, fancy_forget_bias_init = 3){
# Initialize parameters of the LSTM (both weights and biases in one matrix)
@sdwfrost
sdwfrost / lstm.py
Created May 17, 2017 11:54 — forked from pranv/lstm.py
An Efficient, Batched, Stateful LSTM layer in Numpy
import numpy as np
from utils import orthogonal, tanh, sigmoid, dtanh, dsigmoid
class LSTM(object):
"""Long Short Term Memory Unit
Parameters
----------
# Example for my blog post at:
# https://danijar.com/introduction-to-recurrent-networks-in-tensorflow/
import functools
import sets
import tensorflow as tf
def lazy_property(function):
attribute = '_' + function.__name__