Skip to content

Instantly share code, notes, and snippets.

View auser's full-sized avatar

Ari auser

View GitHub Profile
@auser
auser / gist:c25f0fb8e6e632d9d69a1a93601204c5
Created March 24, 2020 15:47 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@auser
auser / LinkedListNode.js
Created December 11, 2018 06:03
Just saving this for myself... creating a linked list from a list of nodes.
function LinkedListNode(v) {
this.val = v;
this.next = null
}
LinkedListNode.prototype.print = function() {
let node = this;
while (node) {
process.stdout.write(`${node.val} -> `)
node = node.next
/**
* @param {number} x
* @return {number}
*/
var reverse = function(x) {
let y = 0;
let num = Math.abs(x);
const intMax = Math.pow(2, 31) + 1;
while(num != 0) {
// Not the fastest thing in the world
export default class Middleware {
constructor (methods) {
this.methods = methods;
this.methodsStack = {};
this.originalMethod = {};
methods.forEach (method => {
this.methodsStack[method] = [];
this.originalMethod[method] = this[method];
const splitTotal = (total, n) => {
let arr = [];
let i = 0;
while (i < n) {
arr.push(Math.floor(Math.random() * total) + 1)
i++;
}
const sorted = [0].concat(arr, [total]).sort((a, b) => a - b);
let out = [];
@auser
auser / web3-solc-contract-compile-deploy.js
Created March 2, 2018 20:18 — forked from tomconte/web3-solc-contract-compile-deploy.js
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
model = Sequential()
model.add(Dense(10, input_dim=X_train.shape[1], activation='sigmoid'))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer=Adam(lr=0.01),
loss='binary_crossentropy',
@auser
auser / model.py
Last active April 16, 2020 18:08
def nn(X, y, hiddenLayerSize=10, learningRate=0.01, epochs=100, debug=False):
m = X.shape[1]
outputSize = y.shape[1]
# Make our model
model = dict(
w0 = np.random.randn(m, hiddenLayerSize),
w1 = np.random.randn(hiddenLayerSize, outputSize)
)
@auser
auser / data.py
Last active April 16, 2020 18:09
import numpy as np
import pandas as pd
np.random.seed(1)
# train comes from the titantic dataset provided by
# kaggle (https://www.kaggle.com/c/titanic/data)
df = pd.read_csv('./data/titanic-train.csv')
def preprocess(raw_data):
# Preprocess data
Verifying my Blockstack ID is secured with the address 14xYsyu9E2KocyoSUpByuJ6qZ7RSy3WcAv https://explorer.blockstack.org/address/14xYsyu9E2KocyoSUpByuJ6qZ7RSy3WcAv