Skip to content

Instantly share code, notes, and snippets.

View sigu's full-sized avatar

Sigu Magwa sigu

View GitHub Profile
## quickly run test 10 times and show only failing lines
for i in {1..10}
do
mix test aweb/controllers/account_controller_test.exs | egrep "_test.exs:\d+$"
done
@sigu
sigu / whitespace.sh
Created October 4, 2021 14:04
remove trailing whitespace from files
find . -iname '*.ex' -type f -exec sed -i '' 's/[[:space:]]\{1,\}$//' {} \+
@sigu
sigu / .vimrc
Created December 29, 2019 05:46 — forked from ralphcrisostomo/.vimrc
Jose Mota .vimrc
set nocompatible
call pathogen#infect()
call pathogen#helptags()
let mapleader = ","
syntax enable
" Mappings {{{
" Insert mode mappings {{{
@sigu
sigu / tmux.conf
Created December 29, 2019 05:46 — forked from rajanand02/tmux.conf
Tmux configurations with status bar theme
# set prefix to control-f
set -g prefix C-f
#unbind system defined prefix
unbind C-b
# helps in faster key repetition
set -sg escape-time 0
# start session number from 1 rather than 0
@sigu
sigu / bucket_policy.json
Created June 6, 2018 02:25
granting permision to a sub bucket in amazon s3 bucket. The other items remain private
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket/subbucket/*"
}
@sigu
sigu / push_to_heroku.sh
Last active May 23, 2018 05:55
push sub directory to heroku
#push a subdirectory called backend to heroku
# the branch is develop
git push heroku `git subtree split --prefix backend develop`:master -f
@sigu
sigu / .httaccess
Last active April 20, 2018 08:47
Redirect all non http to https versions of the webite in cpanel
#Comment | Uncomment ''RewriteEngine on'' below if it is not in your public_html .htaccess file
#You only need to have this once in the public_html .htaccess as it covers all other Rewrites
RewriteEngine on
#Comment | Force all URLs to https WITHOUT www
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
#Comment | Force all URLs to https WITH www
RewriteCond %{SERVER_PORT} 80
@sigu
sigu / ruby_install.sh
Created March 19, 2018 08:56
Installing ruby 2.3.1 using asdf on arch linux
#make sure rvm is installed then
rvm pkg install openssl
CC=gcc-6 RUBY_EXTRA_CONFIGURE_OPTIONS="--with-openssl-dir=$HOME/.rvm/usr" asdf install ruby 2.3.1