Skip to content

Instantly share code, notes, and snippets.

Nicolas Hery nicolashery

Block or report user

Report or block nicolashery

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nicolashery
nicolashery / pandas-heroku.md
Created Sep 8, 2012
Deploy Python app using Pandas on Heroku
View pandas-heroku.md

Deploy Python app using Pandas on Heroku

2012-09-08

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
nicolashery / README.md
Created Sep 21, 2012
Python development web server for Windows
View README.md

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.

Usage

Simply put server.py 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
nicolashery / README.md
Created Oct 18, 2012
Python setup on Windows
View README.md

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.

Console2

@nicolashery
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 "http://chocolatey.org/api/v2/" -Source "https://go.microsoft.com/fwlink/?LinkID=230477" ' (if value is empty, using sources in nuget.config file) is 0.9.8.20-beta1. On your machine you have 0.9.8.19 installed.
=====================================================
Chocolatey (0.9.8.19) 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
nicolashery / mongoose-paginate.js
Last active Jan 24, 2018 — forked from craftgear/mongoose_paginate.coffee
Mongoose Paginate plugin
View mongoose-paginate.js
/* Mongoose Paginate plugin
Forked from:
https://gist.github.com/craftgear/1525918
This snippet is inspired by edwardhotchkiss's mongoose-paginate
(https://github.com/edwardhotchkiss/mongoose-paginate)
and works with any methods like where, desc, populate, etc.
The `paginate` method must be called at the end of method chains.
View markdown-cheat-sheet.md

Markdown cheat sheet

# Header 1

## Header 2

### Header 3

This is a paragraph.
@nicolashery
nicolashery / environment-variables-jekyll-templates.md
Last active Aug 23, 2019
Make environment variables available in Jekyll Liquid templates
View environment-variables-jekyll-templates.md

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:

<head>
@nicolashery
nicolashery / solarized-dark.css
Last active Aug 10, 2019 — forked from scotu/solarized.css
Solarized theme stylesheets for Jekyll and Pygments
View solarized-dark.css
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@nicolashery
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
nicolashery / example.js
Last active May 18, 2019
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) {
chunks1.push(chunk.toString());
var pieces = (soFar + chunk).split('\n');
You can’t perform that action at this time.