Skip to content

Instantly share code, notes, and snippets.

View sigu's full-sized avatar

Sigu Magwa sigu

View GitHub Profile
@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
@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 / 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 / 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 / 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 / .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 / whitespace.sh
Created October 4, 2021 14:04
remove trailing whitespace from files
find . -iname '*.ex' -type f -exec sed -i '' 's/[[:space:]]\{1,\}$//' {} \+
## 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 / signoff
Created April 30, 2024 12:54 — forked from dhh/signoff
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
{
"type": "FeatureCollection",
"name": "Commercial zones",
"features": [
{ "type": "Feature", "properties": { "id": 1, "name": "CBD", "areas": "Central", "AREA": 53.538, "layer": "CBD", "path": "E:/SEURECA KISUMU/GIS FILES/Working Data Files/Central Business District.shp" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 34.7448578, -0.109029 ], [ 34.7451312, -0.1089313 ], [ 34.7452948, -0.1088572 ], [ 34.7453113, -0.1088497 ], [ 34.7454556, -0.1086136 ], [ 34.7456071, -0.1084816 ], [ 34.7457018, -0.1083176 ], [ 34.7458219, -0.1081691 ], [ 34.745835, -0.1081529 ], [ 34.7458901, -0.1081173 ], [ 34.7460737, -0.107999 ], [ 34.746205, -0.1079348 ], [ 34.7462688, -0.1079035 ], [ 34.7465528, -0.1079328 ], [ 34.7468921, -0.1079853 ], [ 34.7472843, -0.1081073 ], [ 34.7475781, -0.1082254 ], [ 34.7476325, -0.1082588 ], [ 34.7476771, -0.1083202 ], [ 34.7477744, -0.1084544 ], [ 34.7479306, -0.108694 ], [ 34.7478104, -0.1088907 ], [ 34.7477354, -0.1091142 ], [ 34.7478962, -0.1094161 ], [ 34.7479342, -0.1093717 ], [