Skip to content

Instantly share code, notes, and snippets.

View kylemcdonald's full-sized avatar

Kyle McDonald kylemcdonald

View GitHub Profile
@ssahu
ssahu / fb_profile_img.sh
Created June 13, 2015 00:03
Download fb-profile-images
#!/bin/bash
# This script downloads the profile images of facebook profile ids from 1 to 10
# change the start and end ids and use it - does not require any login
for i in {1..10}; do wget http://graph.facebook.com/picture?id=$i&width=10000 -O $i.jpg; done
@d02k01
d02k01 / invert.py
Last active December 13, 2015 12:12
deep-goggle-chainer (port https://github.com/aravindhm/deep-goggle to python)
#!/usr/bin/env python
import numpy as np
from PIL import Image
import chainer
from chainer import cuda
from chainer import optimizers
import chainer.functions as F
from chainer.links import caffe
@mikko
mikko / gist:b7faa95a84cf0afec3f6
Last active April 27, 2016 23:11
NodeJS production deploy to single server
Sources:
===============
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04
https://github.com/yyx990803/pod
https://www.namecheap.com/support/knowledgebase/article.aspx/1162/46/how-can-i-point-my-domain-name-to-my-home-servers-ip
Basic setup
@rygorous
rygorous / gist:c651b3a2be11cf7a384a
Created March 13, 2015 02:06
Re-re-re-rediscovery...
(On a math problem, the solutions of which have been independently discovered in
essentially every field that encountered it, because nobody seems to come up
with a name that others think to search for. This is copy & pasted from an old
mail.)
It's actually easy to find papers on this because this problem has been chewed on by dozens
of researchers over decades, all of them unaware of each other's work (...great).
Here's some pointers:
#!/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
@kuanb
kuanb / traffic-cameras.json
Created September 8, 2015 15:40
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"
@tencia
tencia / vae_simple.py
Last active February 25, 2020 13:09
Variational Auto-Encoder using Lasagne
import sys
import os
import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import time
from PIL import Image
from scipy.stats import norm
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
@ktnyt
ktnyt / chainer_ca.py
Last active August 10, 2020 17:41
Refactored code for a Convolutional Autoencoder implemented with Chainer.
import argparse
import numpy as np
from chainer import Variable, FunctionSet, optimizers, cuda
import chainer.functions as F
import cv2
import random
import cPickle as pickle
import sys
class ConvolutionalAutoencoder(FunctionSet):
'use strict';
const fetch = require('node-fetch');
const msautils = require('./utils');
let apikey;
function setApiKey(_apikey) {
apikey = _apikey;
@cibomahto
cibomahto / format.h
Last active September 21, 2021 15:04
Pattern file format
//! @brief Pattern file recorder/playback
//!
//! The purpose is to allow capure and playback of streamed pattern data. The
//! recorder is intended to capture raw data and sync packets directly from the
//! listener (ie, before mapping or color/brightness manipulation is applied).
//! During playback, the raw packets are sent to the mapper for processing.
//! This allows the mapping and output settings to be adjusted after recording.
//!
//! Packets are recorded with a time resolution of 1 ms.
//!