Skip to content

Instantly share code, notes, and snippets.

View springcoil's full-sized avatar

Peadar Coyle springcoil

View GitHub Profile
Peadars-MBP% http GET http://localhost:8081/John_Smith
HTTP/1.1 200 OK
Content-Length: 20
Content-Type: text/plain; charset=utf-8
Date: Tue, 20 Sep 2016 20:26:38 GMT
Welcome, John_Smith!
Peadars-MBP% http GET http://localhost:8081/about.html
HTTP/1.1 200 OK
@springcoil
springcoil / experiments_keras_lstm_text_generation.txt
Created September 20, 2016 18:54
Some experiments with output of LSTM
advocate of th"
do, not simply the timely
advocate of the experiences, averchest is
innoctuality confiveding--that the easily teg hold and will to obligely back tidian itself, seens which trust
agains, as soorobtfrowing us is depresses "wever diffyclies histancutwist lisely to the eng then
intervalate, or with schopenhaa first what questionchformer of clarn"! if is conclussible man. what power asoluou,us ofs as there it oppeare; one
very wace suspendil
antitheses exist at all; a"
stly, whether
@springcoil
springcoil / cross_validation.py
Created August 28, 2016 17:19
Here's an example of Cross-validation for PyFlux - needs some refactoring
def time_series_cross_validation_2(model, data, params, number_folds=10):
"""
Performs a k-fold cross-validation on a Time Series as described by
Rob Hyndman.
See Also:
http://robjhyndman.com/hyndsight/crossvalidation/
Arguments:
model: a model somewhere...
database (numpy.ndarray): uses 'data' matrix to perform
cross-validation.
@springcoil
springcoil / docker_machine.sh
Created July 9, 2016 17:38
A very useful bash script for running Docker containers on AWS
docker-machine create \
--driver amazonec2 \
--amazonec2-access-key LOL \
--amazonec2-secret-key CATS \
--amazonec2-vpc-id vpc \
--amazonec2-security-group security-group \
--amazonec2-instance-type "m4.2xlarge" \
--amazonec2-root-size 20 \
--amazonec2-request-spot-instance \
--amazonec2-spot-price 0.20 \
@springcoil
springcoil / optics.py
Created February 8, 2016 21:27 — forked from rnowling/optics.py
Customer Segmentation Pipeline Prototype
"""
Copyright 2015 Ronald J. Nowling
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@springcoil
springcoil / Stan_error.ipynb
Created January 14, 2016 18:24
An error of a translated model from Stan to PyMC3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / fibonacci_efficiency.ipynb
Created January 6, 2016 21:25
A comparison of generator methods with boring function-based methods for fizz buzz
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springcoil
springcoil / fibonacci.py
Created January 6, 2016 20:57
Fibonacci fun with generators
def fib(a=1, b=1):
while True:
yield a
a, b = b, a + b
from itertools import islice
list(islice(fib(), 10))
Peadars-MBP% pip uninstall lightfm
Uninstalling lightfm-1.7:
/Users/peadarcoyle/anaconda/lib/python3.4/site-packages/lightfm-1.7-py3.4-macosx-10.5-x86_64.egg
Proceed (y/n)? y
Successfully uninstalled lightfm-1.7
Peadars-MBP% pip install lightfm
Collecting lightfm
Using cached lightfm-1.7.tar.gz
Requirement already satisfied (use --upgrade to upgrade): numpy in ./anaconda/lib/python3.4/site-packages (from lightfm)
Building wheels for collected packages: lightfm
@springcoil
springcoil / Fun_with_Elixir.exs
Last active January 4, 2016 21:57
Some fun with elixir
iex> Enum.map([1, 2, 3], fn x -> x * 3 end)
[3, 6, 9]
iex> Enum.map(%{1 => 2, 3 => 4}, fn {k, v} -> k * v end)
[2, 12]