Skip to content

Instantly share code, notes, and snippets.


Nicolas Hery nicolashery

View GitHub Profile
nicolashery /
Created Sep 8, 2012
Deploy Python app using Pandas on Heroku

Deploy Python app using Pandas on Heroku


This document explains how to deploy a Python app that uses the Pandas library on Heroku.

Heroku builds Numpy (one of Pandas' requirements) fine. However, when trying to deploy an app with both numpy and pandas in its requirements.txt file (or even just pandas), for some reason it fails

nicolashery /
Created Sep 21, 2012
Python development web server for Windows

Python development web server for Windows

This is a simple Python script to serve static files from any project directory, useful when doing web development.


Simply put and server.cmd in a directory, for instance C:\Users\YourName\bin and add that directory to your PATH.

Then in the console, cd to your project folder, type server and hit Enter (it will run on port 8000 by default, use server 5000 for example to change port). Use Ctrl+C to stop the server.

nicolashery /
Created Oct 18, 2012
Python setup on Windows

Python setup on Windows

Last updated: Oct 2012

This document is a step-by-step walkthrough on how to set up Python and various tools on a Windows 7 environment.

The primary goal is to have a Python setup that can be used for data analysis, but some more general tools are also installed.


nicolashery / choco.txt
Created Dec 5, 2012
Chocolatey v0.9.8.20 testing
View choco.txt
Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.
> chocolatey update -pre
The most recent version of chocolatey available from '-Source "" -Source "" ' (if value is empty, using sources in nuget.config file) is On your machine you have installed.
Chocolatey ( is installing chocolatey to "C:\Chocolatey\lib". By installing you accept the license for the
package you are installing (please run chocolatey /? for full license acceptance terms).
nicolashery / mongoose-paginate.js
Last active Jan 24, 2018 — forked from craftgear/
Mongoose Paginate plugin
View mongoose-paginate.js
/* Mongoose Paginate plugin
Forked from:
This snippet is inspired by edwardhotchkiss's mongoose-paginate
and works with any methods like where, desc, populate, etc.
The `paginate` method must be called at the end of method chains.

Markdown cheat sheet

# Header 1

## Header 2

### Header 3

This is a paragraph.
nicolashery /
Last active Jul 13, 2021
Make environment variables available in Jekyll Liquid templates

Environment variables in Jekyll templates

This is one way to pass some data (API tokens, etc.) to your Jekyll templates without putting it in your _config.yml file (which is likely to be committed in your GitHub repository).

Copy the environment_variables.rb plugin to your _plugins folder, and add any environment variable you wish to have available on the site.config object.

In a Liquid template, that information will be available through the site object. For example, _layouts/default.html could contain:

nicolashery / solarized-dark.css
Last active Aug 13, 2021 — forked from scotu/solarized.css
Solarized theme stylesheets for Jekyll and Pygments
View solarized-dark.css
/* Solarized Dark
For use with Jekyll and Pygments
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
nicolashery / poisson.js
Created Jun 28, 2013
Quick JavaScript implementation of Exponential and Geometric random number generators
View poisson.js
/* Quick implementation of Exponential and Geometric random number generators
For example you can use it to simulate when an event is going to happen next, given its average rate:
Buses arrive every 30 minutes on average, so that's an average rate of 2 per hour.
I arrive at the bus station, I can use this to generate the next bus ETA:
randomExponential(2); // => 0.3213031016466269 hours, i.e. 19 minutes
nicolashery / example.js
Last active Mar 3, 2021
Combine a pipe of multiple Node.js streams into one stream
View example.js
var util = require('util')
, Transform = require('stream').Transform
, StreamCombiner = require('./streamcombiner');
var chunks1 = [];
var stream1 = new Transform();
var soFar = '';
stream1._transform = function(chunk, encoding, done) {
var pieces = (soFar + chunk).split('\n');