Skip to content

Instantly share code, notes, and snippets.

View rogerdehe's full-sized avatar

崔小二 rogerdehe

  • 广东省深圳市
View GitHub Profile
@rogerdehe
rogerdehe / min-char-rnn.py
Created June 13, 2017 06:22 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@rogerdehe
rogerdehe / better-nodejs-require-paths.md
Created April 18, 2016 09:56 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions