Skip to content

Instantly share code, notes, and snippets.

View kylemcdonald's full-sized avatar

Kyle McDonald kylemcdonald

View GitHub Profile
kylemcdonald /
Last active August 8, 2018 00:23 — forked from frkd-dev/
Build netatalk 3.1.11 on Ubuntu 16.04
# Enable extended attributes on filesystem
# 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 /
Created March 26, 2018 18:21 — forked from HTLife/
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 /
Last active May 19, 2018 17:42 — forked from kastnerkyle/
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
# Thanks to Laurent Dinh for examples of parameter saving/loading in PyTorch
# Thanks to Sean Robertson for
from tqdm import tqdm
from torch.autograd import Variable
import torch.nn as nn
import torch
kylemcdonald / traffic-cameras.json
Last active July 14, 2016 21:41 — forked from camb416/traffic-cameras.json
All traffic camera locations in NYC
View traffic-cameras.json
"lat": "40.79142677512476",
"lng": "-73.93807411193848",
"name": "1 Ave @ 110 St",
"camera": ""
}, {
"lat": "40.800426144169315",
"lng": "-73.93155097961426",
"name": "1 Ave @ 124 St",
"camera": ""
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# this is a quick implementation of
# 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 / scratchml.xml
Created January 22, 2012 23:19 — forked from jamiew/scratchml.xml
ScratchML draft spec v3
View scratchml.xml
* version -- minor versions for small changes, major for incompatibilities
* info -- general file metadata: author info, client info etc.
* turntable - hardware metadata
* mixer -- hardware metadata
View sketchup_downloader.rb
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
kylemcdonald / ArduinoTemperatureFlashlight.ino
Created December 8, 2011 18:22 — forked from jywarren/blinkm-maxm-rgb-knob.ino
BlinkM MaxM RGB color from a knob
View ArduinoTemperatureFlashlight.ino
#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(){