Skip to content

Instantly share code, notes, and snippets.

View alfredormz's full-sized avatar
:octocat:

Alfredo Ramírez alfredormz

:octocat:
View GitHub Profile
@alfredormz
alfredormz / postgres-brew.md
Created March 12, 2020 01:08 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@alfredormz
alfredormz / clear-sidekiq-jobs.sh
Created December 6, 2019 12:51 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@alfredormz
alfredormz / gist:1d2eb462b76048619df87e1d9e5bed79
Created December 10, 2018 23:17
Quickly peek at a file in the lower 3rd of a tmux session
peek() { tmux split-window -p 33 "$EDITOR" "$@" || exit; }
@alfredormz
alfredormz / ctags setup
Created November 10, 2018 15:55
ctags setup on mac
brew install ctags
alias ctags="`brew --prefix`/bin/ctags"
alias ctags >> ~/.zshrc
ctags -R --exclude=.git --exclude=.gs --exclude=node_modules --exclude=log *
echo tags >> .git/info/exclude
@alfredormz
alfredormz / fzf_default_command.sh
Created October 22, 2018 20:01
Fzf default command for Ag
export FZF_DEFAULT_COMMAND='ag -l --path-to-ignore ~/.ignore --nocolor --hidden -g ""'
@alfredormz
alfredormz / How to install specific NodeJS version.md
Created May 11, 2018 21:47
How to install specific NodeJS version
$ brew search node

heroku/brew/heroku-node ✔     libbitcoin-node               node                          node@4                        node@8                        nodeenv
leafnode                      llnode                        node-build                    node@6                        nodebrew                      nodenv

$ brew unlink node

$ brew install node@8
@alfredormz
alfredormz / dockerized-postgresql-development-environment.md
Created March 17, 2018 22:30
Dockerized Postgresql development environment

The data volume container

docker create -v /var/lib/postgresql/data --name postgres10.3-data busybox

Creating the postgresql container

docker run --name local-postgres10.3 -e POSTGRES_PASSWORD=postgres -d --volumes-from postgres10.3-data postgres:10.3
@alfredormz
alfredormz / disable-dashboard.md
Created February 23, 2018 17:09
Disable the Mac OS Dashboard

To disable the dashboard:

defaults write com.apple.dashboard mcx-disabled -boolean YES && killall Dock

To reverse it and re-enable it:

defaults write com.apple.dashboard mcx-disabled -boolean NO && killall Dock
@alfredormz
alfredormz / commits-by-author.md
Last active February 22, 2018 13:37
Git commit stats by author

Number of commit by user

git shortlog -s -n

Alias

git config --global alias.who '!echo "== Commits by Author:\n`git shortlog -s -n`\n"'
@alfredormz
alfredormz / create_fast_cassandra_cluster.sh
Created February 15, 2018 03:15
Running Cassandra Cluster on Docker
docker pull spotify/cassandra:cluster
docker volume create cassandra_data_c1
docker volume create cassandra_data_c2
docker volume create cassandra_data_c3
#create tokens
python -c 'print([int(((2**64 / 3) * i) - 2**63) for i in range(3)])'
#[-9223372036854775808, -3074457345618258944, 3074457345618257920]