Skip to content

Instantly share code, notes, and snippets.

View luthfianto's full-sized avatar

Rizky Luthfianto luthfianto

View GitHub Profile
@kylemcdonald
kylemcdonald / Keras 1D and 2D.ipynb
Created January 30, 2016 05:26
A bug in Keras?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Marak
Marak / simpleHttpRequest.js
Last active December 26, 2015 20:29
hook.io example microservice for sending outgoing http requests
module['exports'] = function simpleHttpRequest (hook) {
// npm modules available, see: http://hook.io/modules
var request = require('request');
request.get('http://httpbin.org/ip', function(err, res, body){
if (err) {
return hook.res.end(err.messsage);
}
hook.res.end(body);
})
};
@honnibal
honnibal / theano_mlp_small.py
Last active March 1, 2023 15:10
Stripped-down example of Multi-layer Perceptron MLP in Theano
"""A stripped-down MLP example, using Theano.
Based on the tutorial here: http://deeplearning.net/tutorial/mlp.html
This example trims away some complexities, and makes it easier to see how Theano works.
Design changes:
* Model compiled in a distinct function, so that symbolic variables are not in run-time scope.
* No classes. Network shown by chained function calls.
@nicolewhite
nicolewhite / northwind.markdown
Last active January 25, 2023 07:55
MySQL to Neo4j

From SQL to Neo4j: Northwind

SQL Model

Neo4j Model

Get the SQL Dump

The SQL dump was stolen from here and imported into MySQL.

@paulirish
paulirish / bling.js
Last active May 10, 2025 11:02
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@craffel
craffel / draw_neural_net.py
Created January 10, 2015 04:59
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
@jacius
jacius / heap.rs
Created July 7, 2014 18:06
Implementation of a generic binary heap data structure in Rust (0.11). Just for funsies.
pub struct Heap<T> {
data: Vec<T>
}
impl<T: PartialOrd> Heap<T> {
/// Create a new empty heap.
pub fn new() -> Heap<T> {
Heap { data: Vec::<T>::new() }
}
@wh5a
wh5a / QuickCheck.scala
Created November 10, 2013 05:09
Coursera Reactive Scala Programming #1 - Quickcheck
package quickcheck
import common._
import org.scalacheck._
import Arbitrary._
import Gen._
import Prop._
import Math._
@quiver
quiver / trie-autocomplete.py
Created April 4, 2013 15:47
trie-based autocomplete using redis/python
# vim: set fileencoding=utf8
'''
References
- http://stackoverflow.com/a/1966188
- http://en.wikipedia.org/wiki/Tree_(data_structure)
$ python suggest.py prefix
'''
import sys
import redis
@barrypitman
barrypitman / TurboLinksUrlFilter.java
Created January 25, 2013 20:58
Allow Turbolinks to update the browser address bar correctly after an ajax request is redirected
/**
* Provide the correct response URL to turbolinks in the 'X-XHR-Current-Location' header. Used to update the browser
* history after an ajax request is redirected.
*
* @author barry
* @since 2013/01/24 11:46 AM
*/
public class TurboLinksUrlFilter implements Filter {
/**