Skip to content

Instantly share code, notes, and snippets.

View adrianseeley's full-sized avatar

Adrian Seeley adrianseeley

  • Adrian Seeley
  • Canada
View GitHub Profile
@adrianseeley
adrianseeley / start.sh
Created July 28, 2017 14:07
Node Popup ec2
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 8.2.1
node -e "console.log('Running Node.js ' + process.version)"
wget ZIPURL
unzip ZIPNAME
node FILENAME
@adrianseeley
adrianseeley / app.js
Created July 23, 2017 16:43
iTunes Custom Sort
const inFile = './Game.xml';
const outFileDiscover = './GameDiscover.xml';
const outFileExploit = './GameExploit.xml';
const fs = require('fs');
const regexIndexOf = (str, regex, end) => {
var match = str.match(regex);
return match.index + (end ? match[0].length : 0);
};
@adrianseeley
adrianseeley / calendar.cs
Created July 21, 2017 02:42
calendar.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace CalCal
{
class Program
<html>
<head>
<title>Tic Tac Toe</title>
<style>
body {
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
ffmpeg -framerate 10 -i ./img/%06d.png -s:v 1280x720 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p ./ani.mp4
@adrianseeley
adrianseeley / dwight.html
Created December 13, 2016 22:17
image GA
<html>
<body>
Max Iterations: <input id="max_iterations" type="text" value="1500"><br>
Max Shapes: <input id="max_shapes" type="text" value="100"><br>
Annealing Rate: <input id="annealing_rate" type="text" value="0.999"><br>
Starting Temperature: <input id="starting_temperature" type="text" value="0.04"><br>
<input id="input" type="file" onchange="return load_image();"><br>
<canvas id="original"></canvas>
<canvas id="rendered"></canvas><br>
<span id="status"></span>
@adrianseeley
adrianseeley / incr.js
Created September 16, 2016 18:21
Incremental stats
var stats = {
q: 0,
count: 0,
min: Infinity,
max: -Infinity,
sum: 0,
mean: 0
};
var variance = stats.q / stats.count;
@adrianseeley
adrianseeley / app.js
Last active November 9, 2017 06:43
Neural Network with Backpropagation, Bootstrapping and Bagging (Uses MSE)
function mse (errors) {
var sum = 0;
for (var i = 0; i < errors.length; i++) {
sum += Math.pow(errors[i], 2);
}
return sum / errors.length;
};
function zero_array (size) {
var ary = [];
@adrianseeley
adrianseeley / rf.js
Last active October 21, 2015 01:32
Mighty RF
var fs = require('fs');
var rl = require('readline');
function read_train (cb) {
var train_inputs = [];
var train_outputs = [];
var headers_read = false;
var file = rl.createInterface({input: fs.createReadStream('./train.csv')});
file.on('line', function (line) {
if (!headers_read) {
@adrianseeley
adrianseeley / .js
Created July 30, 2015 20:21
sample
// my suggested pattern
tradeOffers.getOffers(getOffersOpts, function (err, offers) {
if (err) {
return console.error(err);
}
console.log('Offers:', offers);
});
// the original