Skip to content

Instantly share code, notes, and snippets.

View kylemcdonald's full-sized avatar

Kyle McDonald kylemcdonald

View GitHub Profile
@kylemcdonald
kylemcdonald / netatalk-build.sh
Last active August 8, 2018 00:23 — forked from frkd-dev/netatalk-build.sh
Build netatalk 3.1.11 on Ubuntu 16.04
#!/bin/bash
# Enable extended attributes on filesystem
# http://netatalk.sourceforge.net/wiki/index.php/Install_Netatalk_3.1.11_on_Ubuntu_16.04_Xenial#Setting_Up
# Get system to updated state and install required packages
sudo apt update
sudo apt full-upgrade -y
sudo apt install -y clang make libdb-dev libgcrypt20-dev libavahi-client-dev libpam0g-dev
@kylemcdonald
kylemcdonald / summary.py
Created March 26, 2018 18:21 — forked from HTLife/summary.py
Pytorch model summary
import torch as th
from collections import OrderedDict
def summary(input_size, model):
def register_hook(module):
def hook(module, input, output):
class_name = str(module.__class__).split('.')[-1].split("'")[0]
module_idx = len(summary)
m_key = '%s-%i' % (class_name, module_idx+1)
@kylemcdonald
kylemcdonald / pytorch_char_rnn.py
Last active May 19, 2018 17:42 — forked from kastnerkyle/pytorch_char_rnn.py
Pytorch char rnn as a script, based on examples from Kyle McDonald, Laurent Dinh, and Sean Robertson
# Special thanks to Kyle McDonald, this is based on his example
# https://gist.github.com/kylemcdonald/2d06dc736789f0b329e11d504e8dee9f
# Thanks to Laurent Dinh for examples of parameter saving/loading in PyTorch
# Thanks to Sean Robertson for https://github.com/spro/practical-pytorch
from tqdm import tqdm
from torch.autograd import Variable
import torch.nn as nn
import torch
@kylemcdonald
kylemcdonald / traffic-cameras.json
Last active July 14, 2016 21:41 — forked from camb416/traffic-cameras.json
All traffic camera locations in NYC
[{
"lat": "40.79142677512476",
"lng": "-73.93807411193848",
"name": "1 Ave @ 110 St",
"camera": "http://207.251.86.238/cctv261.jpg"
}, {
"lat": "40.800426144169315",
"lng": "-73.93155097961426",
"name": "1 Ave @ 124 St",
"camera": "http://207.251.86.238/cctv254.jpg"
@kylemcdonald
kylemcdonald / PRs_merged_since_0.8.4.md
Last active November 1, 2015 19:24 — forked from bilderbuchi/PRs_merged_since_0.8.4.md
PRs that have been merged since the 0.8.4 release
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# this is a quick implementation of http://arxiv.org/abs/1508.06576
# BUT! This is kind of dirty. Lots of hard coding. 
import numpy as np
import math
from chainer import cuda, Function, FunctionSet, gradient_check, Variable, optimizers
import chainer.functions as Fu
@kylemcdonald
kylemcdonald / scratchml.xml
Created January 22, 2012 23:19 — forked from jamiew/scratchml.xml
ScratchML draft spec v3
<sml>
<!--
# SCRATCH MARKUP LANGUAGE, WORKING DRAFT
http://scratchml.com
* version -- minor versions for small changes, major for incompatibilities
* info -- general file metadata: author info, client info etc.
* turntable - hardware metadata
* mixer -- hardware metadata
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'httparty'
unless ARGV[0] && ARGV[1]
puts "Usage: ruby sketchup_downloader.rb path/to/terms.csv path/to/folder"
exit 1
end
@kylemcdonald
kylemcdonald / ArduinoTemperatureFlashlight.ino
Created December 8, 2011 18:22 — forked from jywarren/blinkm-maxm-rgb-knob.ino
BlinkM MaxM RGB color from a knob
#include <i2cmaster.h>
#include "Wire.h"
#include "BlinkM_funcs.h"
const float lowReading = 75;
const float highReading = 110;
const int blinkm_addr = 0;
const unsigned char separatorCharacter = 255;
void setup(){