Skip to content

Instantly share code, notes, and snippets.

View luiskhernandez's full-sized avatar

Luis Carlos Hernandez Macias luiskhernandez

View GitHub Profile
@luiskhernandez
luiskhernandez / gist:647976badb46a41b4d81
Created December 28, 2015 14:15
Issue running rubocop in vim, wrong ruby version.
rvm also has this problem. If zsh is your default shell when it starts /etc/zshenv gets executed.
This executes /usr/libexec/path_helper. That sets up the path based on the contents /etc/paths and /etc/paths.d/.
The faq for rvm mentions moving /etc/zshenv to /zsh/zshrc. I did this and it removed the /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin from the start of my path in macvim.
@luiskhernandez
luiskhernandez / gist:e5df26e2129ee823ca3d
Created December 12, 2015 14:07
Install vim with python and ruby support
brew install vim --with-features=huge --enable-interp=lua,ruby,perl,python
@luiskhernandez
luiskhernandez / init.vim
Created March 21, 2019 01:44 — forked from celso/init.vim
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@luiskhernandez
luiskhernandez / Api controller
Last active September 24, 2019 15:39
Devise authenticate_user_from_token
class ApplicationController < ActionController::API
before_action :authenticate_user_from_token!
def authenticate_user_from_token!
auth_token = request.headers['Authorization']
auth_token ? authenticate_with_token!(auth_token) : authentication_error
end
def authenticate_with_token!(token)
unless token.include?(':')
@luiskhernandez
luiskhernandez / db.json
Created October 30, 2020 13:39
db.json
{
"exercises": [
{
"id": 13,
"name": "10 Month Position Dumbbell Press",
"video_url": "https://www.youtube.com/watch?v=z03wi63jUy0",
"created_at": "2020-04-05T19:54:32.423-05:00",
"updated_at": "2020-04-05T19:54:32.423-05:00",
"url": "https://www.thefitprocess.com/exercises/13.json",
"key": 13,
@luiskhernandez
luiskhernandez / helpful-docker-commands.sh
Created July 28, 2022 11:27 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container