Skip to content

Instantly share code, notes, and snippets.

View bazay's full-sized avatar
🇬🇧
London, UK

Baron Bloomer bazay

🇬🇧
London, UK
View GitHub Profile
#!/bin/bash
#
# authorize_app (path_to_file): A MAC OS X script to permit untrusted source apps to run.
#
# WARN: This is a security risk and should only be used on applications you trust.
function authorize_app () {
if [[ -z "$1" ]]; then
echo "ERROR: Please provide a file path to the application for authorization."
echo " authorize_app PATH"
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
@bazay
bazay / VIM.json
Created December 9, 2019 07:42
My current iTerm2 profile for NVIM
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.14117647707462311,
"Color Space" : "sRGB",
"Blue Component" : 0.78431373834609985,
"Alpha Component" : 1,
@bazay
bazay / init.vim
Last active December 9, 2019 07:44
My config for nvim
" Call PlugInstall to install new plugins
call plug#begin('~/.config/nvim/bundle')
" Initialize plugin system
Plug 'daylerees/colour-schemes', { 'rtp': 'vim/' }
Plug 'arcticicestudio/nord-vim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Deoplete – Code Completion Engine
Plug 'scrooloose/nerdcommenter' " Nerd Commenter - Vim plugin for intensely orgasmic commenting
Plug 'scrooloose/nerdTree' " Nerdtree – Tree File Explorer
Plug 'Xuyuanp/nerdtree-git-plugin' " Nerdtree Git Plugin - for above plugin
Plug 'mattn/emmet-vim' " Emmet – HTML Expansion
@bazay
bazay / gup.sh
Created May 28, 2019 15:18
A helpful bash script that allows you to simply
#!/bin/bash
#
# gup BRANCH
#
# Update origin with upstream for a specified branch. This allows you to update a branch on your forked repo
# with the most up-to-date version on the parent, all via the CLI.
#
# Note* This function assumes the following remotes:
# 1. `origin` - Refers to your forked repository, required;
# 2. `upstream` - The parent of your forked repository.
@bazay
bazay / kill_port.sh
Last active May 28, 2019 15:20
A helpful Bash script that allows you to find a process running on a particular port and terminate it. Particularly useful for us web developers ;)
#!/bin/bash
#
# kill_port PORT
#
# Find process running on a particular port and terminate it.
kill_port () {
if [[ -z "$1" ]]; then
echo 'Please specify PORT arg, e.g:'
echo ' kill_port PORT'
@bazay
bazay / readline_bundle_not_found_mojave_osx.md
Created February 13, 2019 16:48
How to fix readline.bundle not found error from the CLI on Mojave OSX (MAC)

The following error:

/Users/bazay/.rvm/gems/ruby-2.3.4@your_repository/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:in `require': dlopen(/Users/bazay/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
  Referenced from: /Users/bazay/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/x86_64-darwin17/readline.bundle
  Reason: image not found - /Users/bazay/.rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/x86_64-darwin17/readline.bundle

When running rails or byebug can be resolved with the following command:

ln -s /usr/local/opt/readline/lib/libreadline.8.dylib /usr/local/opt/readline/lib/libreadline.7.dylib