Skip to content

Instantly share code, notes, and snippets.

View StuartFarmer's full-sized avatar
🏹
take the shot

Stuart Farmer StuartFarmer

🏹
take the shot
  • Lisbon, Portugal
View GitHub Profile
@StuartFarmer
StuartFarmer / Faucet.sol
Created July 17, 2017 15:07
Faucet.sol
pragma solidity ^0.4.11;
contract Faucet {
address issuer;
mapping (address => uint256) lastDraw;
uint payout;
uint period;
function Faucet(uint _payout, uint _period) {
### Keybase proof
I hereby claim:
* I am StuartFarmer on github.
* I am stustu (https://keybase.io/stustu) on keybase.
* I have a public key whose fingerprint is D1A9 4323 6469 DA27 A7C7 9266 DBB6 67B1 7E81 4CF8
To claim this, I am signing this object:
@StuartFarmer
StuartFarmer / ma_applied.mq4
Created June 3, 2017 17:07
old ass mql indicator
//+------------------------------------------------------------------+
//| MA_In_Color_wAppliedPrice.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| Modified from LSMA_In_Color to use any MA by Robert Hill |
//| Added use of Applied Price by Robert Hill |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, FX Sniper and Robert Hill"
#property link "http://www.metaquotes.net/"
//---- indicator settings
@StuartFarmer
StuartFarmer / visualizer.py
Created April 26, 2017 01:54
1d data visualizer for playing through data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import csv
import talib
underlying_data = []
with open('./3m_data.csv') as f:
reader = csv.reader(f)
@StuartFarmer
StuartFarmer / pickle_corpus.py
Created March 16, 2017 13:23
MUSICBOT9000 V1 Corpus Pickler
import pickle
from music21 import *
from sklearn import preprocessing
import numpy as np
def encode_from_paths(paths):
songbook = [path for path in paths]
notes = []
for song in songbook:
song = converter.parse(song)
@StuartFarmer
StuartFarmer / generator.py
Last active March 16, 2017 13:25
MUSICBOT9000 V1 Generator
from music21 import *
import numpy as np
from sklearn import preprocessing
import pickle
from keras.layers import Input, Dense, LSTM, merge
from keras.models import Model, load_model
from keras.optimizers import SGD
@StuartFarmer
StuartFarmer / classification-forex-model.py
Created October 24, 2016 02:27
Classification Forex Prediction Model
import csv
import random
import numpy as np
import matplotlib.pyplot as plt
import math
import os
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=gpu,floatX=float32,allow_gc=False"
@StuartFarmer
StuartFarmer / MountainCar config
Last active August 8, 2016 00:04
MountainCar config
#--- parameters for the XOR-2 experiment ---#
# The `Types` section specifies which classes should be used for various
# tasks in the NEAT algorithm. If you use a non-default class here, you
# must register it with your Config instance before loading the config file.
[Types]
stagnation_type = DefaultStagnation
reproduction_type = DefaultReproduction
[phenotype]
@StuartFarmer
StuartFarmer / MountainCar with NEAT
Last active August 11, 2016 22:52
MountainCar with NEAT
from __future__ import print_function
import gym
import numpy as np
import itertools
import os
from neat import nn, population, statistics
# another great example of how crazy effective NEAT can be even when it knows literally nothing about what's going on in the environment.
# I'll refactor this later, but it's almost midnight and I just wanted to demonstrate how sick NEAT is at solving problems without defining any direction for the algoritm
from __future__ import print_function
import gym
import numpy as np
import itertools
import os
from neat import nn, population, statistics