Skip to content

Instantly share code, notes, and snippets.

View julien-langlois's full-sized avatar
here and there

Julien Langlois julien-langlois

here and there
View GitHub Profile
@yann-yinn
yann-yinn / nginx-conf
Created May 17, 2018 07:40
Nginx conf with automatically renewed ssl certificate (cerbot) for NodeJS or React app (or any static files
# first install certbot and then run this command on your server
# certbot certonly --authenticator standalone --pre-hook "nginx -s stop" --post-hook "nginx"
# this will stop for a few seconds your nginx server and generate your Let's Encrypt ssl certificates, and configure
# cron so that certificates are renewed automatically \o/
# now create your nginx conf for your nodejs app :
# on port 80 (http), redirect to httpS (443)
server {
if ($host = www.your-domain.com) {
@exileed
exileed / bitbucket-pipelines.yml
Created April 6, 2018 17:21
Bitbucket pipelines test + Ansible deploy script
image: php:7.1-fpm
pipelines:
default:
- step:
caches:
- composer
script:
# Update dependencies
- apt-get update
# Install dependencies
@brikis98
brikis98 / main.tf
Last active March 14, 2023 23:43
A hacky way to create a dynamic list of maps in Terraform
# The goal: create a list of maps of subnet mappings so we don't have to statically hard-code them in aws_lb
# https://www.terraform.io/docs/providers/aws/r/lb.html#subnet_mapping
locals {
# These represent dynamic data we fetch from somewhere, such as subnet IDs and EIPs from a VPC module
subnet_ids = ["subnet-1", "subnet-2", "subnet-3"]
eips = ["eip-1", "eip-2", "eip-3"]
}
# Here's the hack! The null_resource has a map called triggers that we can set to arbitrary values.
# We can also use count to create a list of null_resources. By accessing the triggers map inside of
@dantleech
dantleech / README.md
Last active October 21, 2021 21:22
PHPStan Drupal Integration
$ composer require phpstan/phpstan

Drupal dynamically adds to the class autoloader at runtime, so it is necessary to bootstrap Drupal in order that it is fully populated. Note that this may require that the database be accessible (i.e. may be problematic when working with Docker). This is why we use a custom autoload file below.

$ ./bin/phpstan analyse --level=7 -c phpstan.neon docroot/modules/custom
@kevbost
kevbost / .zshrc
Last active March 14, 2022 14:10
.oh-my-zsh - My configuration files for OSX
# PATH
# You'll probably need some other path stuff, put it here
# export PATH="$HOME/cool/path:/another/neat/path:$PATH"
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Zsh Theme
ZSH_THEME="nebirhos" # $ZSH/custom/themes/FILE_NAME.zsh-theme
@MatthieuScarset
MatthieuScarset / .lando.yml
Last active August 15, 2024 14:31
Correct settings for XDebug + VSCode + Lando (+3.0)
# Lando version is at least +3.0
name: drupal-nine
recipe: drupal9
services:
appserver:
webroot: web
xdebug: debug
config:
php: .vscode/php.ini
# This is a sample build configuration for Other.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image:
name: pxdeployment/pipelines
username: $DOCKERHUB_USER_ALT
password: $DOCKERHUB_PASS_ALT
email: [email protected]
@ttscoff
ttscoff / changelog.rb
Last active January 4, 2025 07:21
Generate release notes from git commit messages
#!/usr/bin/ruby -W1
# frozen_string_literal: true
require 'optparse'
require 'shellwords'
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged
# release where commit messages contain NEW, FIXED, CHANGED, and IMPROVED
@princebot
princebot / install_wormhole.bat
Created July 29, 2017 17:44
Install Python magic-wormhole on Windows.
::
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and
:: its prerequisites. Run this as an administrator.
::
:: Install chocolatey.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install Python 3.
choco install -y python
@rachellawson
rachellawson / .circleci_config.yml
Created July 7, 2017 21:28
CircleCI for Drupal 8 and Behat
version: 2
jobs:
build:
docker:
- image: circleci/php:7.1-apache-browsers
working_directory: ~/working
steps:
- checkout
- run: