Skip to content

Instantly share code, notes, and snippets.

Jean Lescure jeanlescure

Block or report user

Report or block jeanlescure

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
jeanlescure /
Last active Aug 12, 2019
Get CloudWatch logs from AWS ECS instance and format to be easier to read the timestamps

Get CloudWatch logs from AWS

With easy to read format

CLI Package to fetch CloudWatch logs and format them with human readable datetimes


  • Download all files in this gist
  • Run $ yarn
  • Run $ chmod +x ./
jeanlescure /
Created May 26, 2019
Quickly Setup Hot Reload Environment in OSX
npx browser-sync start -s -f . --no-notify --host `ifconfig | grep "inet " | grep -v | cut -d\ -f2` --port 8080
jeanlescure /
Last active Feb 5, 2019
Javascript optimized function to rename keys of objects in an array
function renameObjectKeys(objArr, renameMap) {
  const keys = Object.keys(renameMap);

  for (let i = objArr.length - 1; i >= 0; i -= 1) {
    for (let j = keys.length - 1; j >= 0; j -= 1) {
      delete Object.assign(
        {[renameMap[keys[j]]]: objArr[i][keys[j]] }
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:certbot/certbot
apt-get update
apt-get install -y gpp python zip unzip mariadb-server nginx python-certbot-nginx
systemctl status mariadb
curl -o- | bash
source ~/.bashrc
nvm install 10.13
npm install -g yarn

Delete all node_modules folders recursively

find . -name "node_modules" -type d -prune -exec rm -rf '{}' +

The -prune option skips child node_modules directories so that only top level node_modules are removed, for better performance.

Share MacOS X directory over NFS


Change wrong user name and email in all commits


git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "incorrect@email" ]; then
     GIT_AUTHOR_NAME="Correct Name";
View coming-soon.html
<link href="" rel="stylesheet">
body {
background: white;
font-family: 'Erica One', cursive;
<div style="text-align:center;font-size:30px;">
<h1 style="font-weight:normal;">COMING SOON</h1>
# Misc operations I use in OSX for PostgreSQL management
# Install brew and postgres
ruby -e "$(curl -fsSL"
brew install postgresql
postgres -V
# If password lost just change 'md5' to 'trust' for all users in following file
sudo vim /Library/PostgreSQL/10.x/data/pg_hba.conf
freebsd-update fetch install
pkg install -y nginx
rm /usr/local/etc/nginx/nginx.conf
wget -O /usr/local/etc/nginx/nginx.conf --no-check-certificate
mkdir -p /var/log/nginx
touch /var/log/nginx/access.log
touch /var/log/nginx/error.log
mkdir -p /usr/local/etc/nginx/sites-enabled/
mkdir -p /usr/local/etc/nginx/sites-available/
nginx -t
View p5.centered.rect.js
var rects = [];
var SQPI = (PI/64);
var xq = 0.01;
function r(x,y,w,h){
var self = this;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
You can’t perform that action at this time.