Skip to content

Instantly share code, notes, and snippets.

View nicolas-besnard's full-sized avatar

Nicolas Besnard nicolas-besnard

View GitHub Profile
@nicolas-besnard
nicolas-besnard / machine.js
Created February 17, 2023 20:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nicolas-besnard
nicolas-besnard / request.json
Last active December 24, 2017 08:48
Mailjet API
{
"requests": {
"g0": {
"resource": "template.full.update",
"operation": "update",
"params": {
"id": 280620
},
"body": {
"ID": 280620,
sudo apt-get install apt-transport-https
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.17.0/docker-compose-$(uname -s)-$(uname -m)"
sudo chmod +x /usr/local/bin/docker-compose
# docker without sudo
{{ range $host, $containers := groupBy $ "Env.VIRTUAL_HOST" }}
upstream {{ $host }} {
{{ range $index, $value := $containers }}
{{ with $address := index $value.Addresses 0 }}
server {{ $address.IP }}:{{ $address.Port }};
{{ end }}
{{ end }}
}
@nicolas-besnard
nicolas-besnard / elasticsearch.sh
Last active March 12, 2018 13:18
Nginx + Puma + Rails + Capistrano on Ubuntu 14.04
#!/usr/bin/env bash
install_elasticsearch() {
echo " * -- Elasticsaerch -- *"
echo " * Update"
sudo apt-get -qq -y update
echo " * Install JDK"
sudo apt-get -qq -y install openjdk-7-jre-headless
echo " * Download deb (V1.4.2)"