Skip to content

Instantly share code, notes, and snippets.

View boocle's full-sized avatar
🏠
Working from home

Maxime Roca boocle

🏠
Working from home
View GitHub Profile
@pyrou
pyrou / docker-compose.yml
Last active March 31, 2025 19:52
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
removecontainers() {
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
}
armageddon() {
removecontainers
docker network prune -f
docker rmi -f $(docker images --filter dangling=true -qa)
docker volume rm $(docker volume ls --filter dangling=true -q)
@npearce
npearce / install-docker.md
Last active May 21, 2025 14:32
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@Mikulas
Mikulas / Dockerfile
Last active March 11, 2022 12:34
Docker image PHP 7.1 alpine with extensions
FROM php:7.1-fpm-alpine
RUN apk add --update \
autoconf \
g++ \
libtool \
make \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
@devdrops
devdrops / example.md
Last active March 19, 2025 16:01
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯
@alces
alces / ansible_local_playbooks.md
Last active June 23, 2025 17:21
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@devynspencer
devynspencer / ansible-github.yml
Last active May 10, 2025 16:47
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@lebretr
lebretr / Promises.md
Last active December 15, 2016 14:09
Javascript: Promises ou Comment résoudre une boucle d'appels asynchrone(webservice, sql,...)

#Javascript: Promises ou Comment résoudre une boucle d'appels asynchrone(webservice, sql,...)

JavaScript est un langage conçu autour de la notion d'évènement, avec une architecture de code entièrement non bloquante (voir OpenClassRoom Nodejs pour plus d'info )

Ainsi, lorsqu'on veut faire une boucle sur un tableau et que l'on appelle une fonction asynchrone (appel webservice, exécution d'un ordre sql,...) à l'intérieur de cette boucle, Javascript ne va pas attendre la fin d'exécution de la fonction avant de traiter l'itération suivante.

Prenons un exemple simple d'une boucle qui va réaliser 3 appels webservices:

console.log('Debut');
for(var i=0; i<=3; i++){
@yaronguez
yaronguez / ACF Country List
Created February 17, 2015 01:37
Country list formatted for Advanced Custom Fields select dropdown
afghanistan : Afghanistan
albania : Albania
algeria : Algeria
american_samoa : American Samoa
andorra : Andorra
angola : Angola
anguilla : Anguilla
antigua_and_barbuda : Antigua and Barbuda
argentina : Argentina
armenia : Armenia
@kolorobot
kolorobot / bootstrap.html
Last active January 21, 2025 17:14
Complete Bootstrap Starter Template with pre-defined CDN paths
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content=""/>
<meta name="author" content=""/>