Skip to content

Instantly share code, notes, and snippets.

View crockpotveggies's full-sized avatar
🥕
carrot

Justin Long crockpotveggies

🥕
carrot
View GitHub Profile
@crockpotveggies
crockpotveggies / docker-compose.kafka.yml
Created May 26, 2021 20:14
Run Kafka in one command using docker-compose
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper
container_name: zookeeper
ports:
- '2181:2181'
environment:
ZOOKEEPER_CLIENT_PORT: '2181'
@crockpotveggies
crockpotveggies / canada-healthregions.json
Last active April 7, 2020 06:04
GeoJSON of Canada's Health Regions and Authorities
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crockpotveggies
crockpotveggies / canada-provinces.json
Created March 16, 2020 21:37
GeoJSON of Canada's individual provinces
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import org.apache.commons.io.FileUtils;
import org.datavec.api.records.reader.SequenceRecordReader;
import org.datavec.api.records.reader.impl.csv.CSVSequenceRecordReader;
import org.datavec.api.split.NumberedFileInputSplit;
import org.deeplearning4j.api.storage.StatsStorage;
import org.deeplearning4j.arbiter.ComputationGraphSpace;
import org.deeplearning4j.arbiter.conf.updater.SgdSpace;
import org.deeplearning4j.arbiter.layers.LSTMLayerSpace;
import org.deeplearning4j.arbiter.layers.OutputLayerSpace;
import org.deeplearning4j.arbiter.optimize.api.OptimizationResult;
@crockpotveggies
crockpotveggies / sort-cifar.js
Last active December 14, 2018 07:43
NodeJS script to sort CIFAR-10 dataset of PNGs into label directories
var fs = require('fs')
var labels = fs.readFileSync('labels.txt', 'utf-8')
.split('\n')
.filter(Boolean);
/*for(i = 0; i < labels.length; i++) {
fs.mkdirSync("./train/"+i);
fs.mkdirSync("./test/"+i);
}*/
@crockpotveggies
crockpotveggies / Mailloy.scala
Created March 26, 2012 23:51
A mailer trait for sending HTML emails for Play! Framework 2.0
/*
* 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@crockpotveggies
crockpotveggies / install-apache-maven-3.3.9.sh
Created April 12, 2018 01:33 — forked from miroslavtamas/install-apache-maven-3.3.9.sh
Install Apache Maven 3.3.9 on CentOS
#!/bin/sh
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzf apache-maven-3.3.9-bin.tar.gz
sudo mkdir /usr/local/maven
sudo mv apache-maven-3.3.9/ /usr/local/maven/
sudo alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
sudo alternatives --config mvn
@crockpotveggies
crockpotveggies / gist:a061311b88cf21d3e662f7834f3a9b03
Last active October 27, 2017 00:35
Sequence to Sequence Autoencoder Preprocessor
object Preprocessor extends Serializable {
class Seq2SeqAutoencoderPreProcessor extends MultiDataSetPreProcessor {
override def preProcess(mds: MultiDataSet): Unit = {
val input: INDArray = mds.getFeatures(0)
val features: Array[INDArray] = Array.ofDim[INDArray](2)
val labels: Array[INDArray] = Array.ofDim[INDArray](1)
features(0) = input