Skip to content

Instantly share code, notes, and snippets.

View RaphaelAudet's full-sized avatar

Raphaël Audet RaphaelAudet

View GitHub Profile
@RaphaelAudet
RaphaelAudet / find_n_rm.sh
Created September 18, 2014 08:50
find and delete files
find . -type f -name "FILE-TO-FIND" -exec rm
@RaphaelAudet
RaphaelAudet / resque_alert.rb
Created September 30, 2014 13:16
Resque Stalled Alert : this script can check if a resque queue is overflowing or a job is "stuck"
require 'date'
require 'redis'
require 'net/smtp'
require 'resque'
require 'resque/version'
class App
VERSION = '0.0.1'
def initialize
@RaphaelAudet
RaphaelAudet / sleep_worker.rb
Last active August 29, 2015 14:07
app/workers/SleepWorker.rb a sleeping worker
class SleepWorker
@queue = :low
def self.perform(args)
sleep 300
end
end
@RaphaelAudet
RaphaelAudet / ghost-production.sh
Created October 27, 2014 15:44
Monit wrapper script for FOREVER running GHOST
#!/bin/bash
export NODE_ENV=production
NAME="ghost-$NODE_ENV"
USER="node"
APP_ROOT="/var/www/ghost"
PID_FILE="/var/www/ghost/$NAME.pid "
export PATH=$PATH:
@RaphaelAudet
RaphaelAudet / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@RaphaelAudet
RaphaelAudet / tmux.conf
Created November 27, 2015 09:28
tmux.conf
# UTF-8
set-option -g status-utf8 on
set-window-option -g utf8 on
# Set 256-colour terminal
set -g default-terminal "screen-256color"
# windows starts at 1
set -g base-index 1
@RaphaelAudet
RaphaelAudet / cfnukes.sh
Last active June 12, 2017 09:52
CloudFoundry destroy apps and services onliners
# FIXME theses scripts dont really play well if the app or services names have spaces
# WARNING theses onlinerss are destructive, please dont copy/paste this without understanding what you are doing, k?
# alias to got to the cloud foundry bluemix test environment and remove all apps and all services with "example"
alias NukeBluemix="export CF_HOME=~/.cf/profiles/bluemix && \
cf apps | grep .eu-gb.mybluemix.net | awk '{print $1}' | xargs -n 1 cf d -f -r && \
cf s | grep example | awk '{print $1}' | xargs -n 1 cf ds -f"
# the same as above but for "example" services only
@RaphaelAudet
RaphaelAudet / styles_regex
Created November 15, 2017 08:25
regex to match all inline styles in html
style=(["'])(?:(?=(\\?))\2.)*?\1
<!--[^>]*-->
data-identifier=(["'])(?:(?=(\\?))\2.)*?\1
data-index=(["'])(?:(?=(\\?))\2.)*?\1
class=(["'])(?:(?=(\\?))\2.)*?\1
compilesafe=(["'])(?:(?=(\\?))\2.)*?\1
tooltip=(["'])(?:(?=(\\?))\2.)*?\1
@RaphaelAudet
RaphaelAudet / qadsrv.sh
Created October 25, 2018 08:27
quick and dirty server
#!/bin/bash
sudo apt-get install zsh
sudo apt-get install build-essential git-core tmux
sudo chsh ubuntu /usr/bin/zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
~/.rbenv/bin/rbenv init
vi ../.zshrc
@RaphaelAudet
RaphaelAudet / code_review_guidelines.md
Created September 22, 2020 08:26
Code review guideline

Code review guidelines

Based on a list Michael Azerhad published on linkedin.

  1. La portée des variables/méthodes/classes
  2. Les traces de muabilité là où l'immuabilité est plus adéquate
  3. L'indentation
  4. Le nommage des méthodes, classes et variables
  5. L'orthographe et la grammaire => très important
  6. Les duplications de code