Skip to content

Instantly share code, notes, and snippets.

View prathe's full-sized avatar

Philippe Rathé prathe

  • Remote, North America
View GitHub Profile
@prathe
prathe / gist:2654048
Created May 10, 2012 15:48
Building and installing Zorba on Mac OSX from sources

Install gcc (Apple release) unless you have it

Needed to compile ICU.

Grab and unpack the tarball

mkdir ~/src && cd ~/src
curl -O http://opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz
tar -zxvf gcc-5666.3.tar.gz

cd gcc-5666.3

@prathe
prathe / node-packages.md
Last active November 26, 2020 14:55
Common React/Node packages used in my projects
$ yarn add [email protected] --save # select alpha version
$ yarn add [email protected] --save # select alpha version
$ yarn add react-bootstrap --save
$ yarn add react-router-dom --save
$ yarn add react-router-bootstrap --save
$ yarn add react-redux --save
@prathe
prathe / screen.sh
Created November 1, 2018 22:04
Managing Linux screens
# create with a name
screen -d -m -S elasticsearch:import:migrate
# list with PIDs
screen -list
# reopen one with PID
screen -r 12345
# Destroy with PID
## .bash_profile
```
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
@prathe
prathe / gitdo.zsh
Last active August 31, 2023 20:27
Git Rspec/Rubocop commands
bundle exec rubocop -c .rubocop_exclusion.yml --fail_level convention --display-only-fail-level-offenses
# Rubocop only files I modified/added, but not the one I deleted
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |xargs bundle exec rubocop
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop --fail_level convention --display-only-fail-level-offenses
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -c .rubocop_exclusion.yml --fail_level convention --display-only-fail-level-offenses
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -A -c .rubocop_exclusion.yml --fail_level convention
git diff --name-
# -A the staged
cat tmp/appstrategy | xargs perl -p -i -e "s/(RSpec.describe .+) do$/\1, auth_strategy: \'app_user_cookies\' do/"

Show all unused index since the last MySQL server restart (MySQL 5.6+)

SELECT object_schema, object_name, index_name
FROM performance_schema.table_io_waits_summary_by_index_usage 
WHERE index_name IS NOT NULL AND count_star = 0
ORDER BY object_schema, object_name;