Skip to content

Instantly share code, notes, and snippets.

View NicolasRitouet's full-sized avatar

Nicolas Ritouet NicolasRitouet

View GitHub Profile
@NicolasRitouet
NicolasRitouet / dokku-alt-DO.md
Last active August 29, 2015 14:18
Dokku alt on DO

How to install Dokku-alt on Digital Ocean

  1. If you want to use your own domain, add the following dns records in the DNS area: Imgur
  2. Create a 5$ droplet on DO with Ubuntu 14.04 x64. Hostname should be your domain name.
  3. SSH into the droplet and create a swap file:
dd if=/dev/zero of=/swapfile bs=1024 count=256k
mkswap /swapfile
swapon /swapfile
@NicolasRitouet
NicolasRitouet / CONTRIBUTING.md
Last active August 29, 2015 14:12
Improve contributing.md of deployd project

Contributing to Deployd

We'd love to have your contribution to deployd. There are several ways to contribute:

// add a table of content of link to different parts with the following list:

  • Build an external module for deployd
  • Open bugs and feature requests for deployd core itself
  • Submit Pull Requests to deployd core
  • Improve documentation
@NicolasRitouet
NicolasRitouet / gitworkflow.md
Last active August 29, 2015 14:11
Git workflow for a nice PR on github

Development phase

For open source projects, it's important to keep the history tree as clean as possible. A clean history tree will facilitate an eventual rollback. Having an easy way to rollback PR means that you can accept more PR.

  1. fork the project https://github.com/deployd/deployd/fork
  2. Define upstream as new remote git remote add upstream git@github.com:deployd/deployd.git
  3. create a new branch git checkout -b feature
  4. add your changes
  5. add tests
  6. commit (multiple times if necessary) git add . && git commit -m "Fix: ..."
@NicolasRitouet
NicolasRitouet / README.md
Last active August 29, 2015 14:10
Default readme.md for dpd modules

dpd-mymodule

Description

Here, describe what this module is about

Getting started

This module requires deployd ~0.7.0.

If you haven't used Deployd before, make sure to read the documentation.

Keybase proof

I hereby claim:

  • I am NicolasRitouet on github.
  • I am nicolasritouet (https://keybase.io/nicolasritouet) on keybase.
  • I have a public key whose fingerprint is A3A7 2BD3 4C6B 1534 106D F86B 634F A803 AD74 62F1

To claim this, I am signing this object:

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@NicolasRitouet
NicolasRitouet / Docker cheat-sheet
Last active August 29, 2015 14:07
Cheat-sheet for Docker
stop all containers:
sudo docker stop $(sudo docker ps -a -q)
Remove all containers:
sudo docker rm $(sudo docker ps -a -q)
Get id of last container:
sudo docker ps -l -q
Stop last container:
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
module.exports = function(sequelize, DataTypes) {
var Page = sequelize.define('Page', {
title: DataTypes.STRING,
content: DataTypes.STRING
});
return Page
}
@NicolasRitouet
NicolasRitouet / encrypt-jboss-password.sh
Created June 23, 2014 15:29
Encrypt datasource password for Jboss eap 6.2
#!/bin/bash
## Build ClassPath for command
MYPATH=`pwd`
CP=
CP=${CP}:$MYPATH/../modules/system/layers/base/org/picketbox/main/picketbox-4.0.19.SP2-redhat-1.jar
CP=${CP}:$MYPATH/../modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.2.GA-redhat-1.jar
echo "$CP"
java -classpath ${CP} org.picketbox.datasource.security.SecureIdentityLoginModule $1