Skip to content

Instantly share code, notes, and snippets.

View herval's full-sized avatar
:shipit:

Herval Freire herval

:shipit:
View GitHub Profile
@herval
herval / stackfile.yml
Last active May 13, 2016 05:00
Daily Postgres Backup from Tutum to S3
backup:
image: 'borja/dockup:latest'
environment:
- AWS_ACCESS_KEY_ID=<SET ME>
- AWS_DEFAULT_REGION=<SET ME>
- AWS_SECRET_ACCESS_KEY=<SET ME>
- BACKUP_NAME=<SET ME>
- PATHS_TO_BACKUP=/var/lib/postgresql/data
- S3_BUCKET_NAME=<SET ME>
restart: on-failure
@herval
herval / shakespeare_rnn.txt
Created October 28, 2015 08:56
Shakespeare generator LSTM RNN
Output from https://github.com/deeplearning4j/dl4j-0.4-examples/blob/master/src/main/java/org/deeplearning4j/examples/rnn/GravesLSTMCharModellingExample.java
Using existing text file at /var/folders/zs/vsf7sw7540s3jrqjf8ty0jfc0000gp/T/Shakespeare.txt
Loaded and converted file: 5459809 valid characters of 5465100 total characters (5291 removed)
22:37:27.108 [main] DEBUG org.reflections.Reflections - going to scan these urls:
jar:file:/Users/herval/.gradle/caches/modules-2/files-2.1/org.nd4j/nd4j-jblas/0.4-rc3.4/1548e2f266bab6e5bc1a5cd3161c4c850c0059c9/nd4j-jblas-0.4-rc3.4.jar!/
jar:file:/Users/herval/.gradle/caches/modules-2/files-2.1/org.nd4j/nd4j-api/0.4-rc3.5/9c16cbc97c0da0dba3b1a9fe4fc2efcfa6d689c1/nd4j-api-0.4-rc3.5.jar!/
jar:file:/Users/herval/.gradle/caches/modules-2/files-2.1/org.nd4j/nd4j-bytebuddy/0.4-rc3.5/e8c11225c9ef69166c328c0b97335f54f3af1955/nd4j-bytebuddy-0.4-rc3.5.jar!/
22:37:27.263 [main] INFO org.reflections.Reflections - Reflections took 148 ms to scan 3 urls, producing 82 keys and 375 v
@herval
herval / int_additions.scala
Created April 18, 2016 14:37
Manipulating maps with Monoids
object MindBlown extends App {
trait Monoid[A] {
def op(a1: A, a2: A): A
def zero: A
}
val intAddition = new Monoid[Int] {
override def op(a1: Int, a2: Int) = a1 + a2
override def zero = 0
}
@herval
herval / main.cpp
Created March 18, 2017 04:48
C++11 syntax & stuff
#include <iostream>
// template (generics)
template<typename F>
auto &f(F &param) {
return param;
}
// TODO reflection
// TODO type casting/switching
### Keybase proof
I hereby claim:
* I am herval on github.
* I am herval (https://keybase.io/herval) on keybase.
* I have a public key ASD9Cs4lUm0LtcLwHZqssHZEH3A6w3WWC_H7jul4nrRLHQo
To claim this, I am signing this object: