Skip to content

Instantly share code, notes, and snippets.

View efrapp's full-sized avatar
🏠
Working from home

Efrain Pinto Ponce efrapp

🏠
Working from home
  • Colombia
View GitHub Profile
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
" ================ General Config ====================
@sshaw
sshaw / shopify_api_retry.rb
Last active May 9, 2021 00:31
Ruby module to retry a Shopify API request if an HTTP 429 (too many requests) is returned. Moved to https://github.com/ScreenStaring/shopify_api_retry with GraphQL support
require "shopify_api"
#
# Retry a ShopifyAPI request if an HTTP 429 (too many requests) is returned.
#
# ShopifyAPIRetry.retry { customer.update_attribute(:tags, "foo") }
# ShopifyAPIRetry.retry(30) { customer.update_attribute(:tags, "foo") }
# c = ShopifyAPIRetry.retry { ShopifyAPI::Customer.find(id) }
#
# By Skye Shaw (https://gist.github.com/sshaw/6043fa838e1cecf9d902)
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active July 4, 2024 15:00
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@jamesmartin
jamesmartin / application_controller.rb
Created May 25, 2015 01:47
Testing ApplicationController before_filter methods using RSpec's "anonymous" controller instance
class ApplicationController < ActionControllerBase
helper :do_something
def do_something
@from_do_something = params[:for_do_something]
end
end
@pifleo
pifleo / README
Created April 5, 2012 10:53
Rails - models organization - Keep code structure in models consistent
# Keep code struture in models consistent
# Inspired by http://rails-bestpractices.com/posts/75-keep-code-struture-in-models-consistent
# One example: (From top to bottom)
associations
scopes
class methods
validates
callbacks
instance methods