Skip to content

Instantly share code, notes, and snippets.

View unflores's full-sized avatar

A Flores unflores

View GitHub Profile
@unflores
unflores / .gemrc
Created March 7, 2016 12:12 — forked from jch/.gemrc
gemrc example
# http://docs.rubygems.org/read/chapter/11
---
gem: --no-ri --no-rdoc
benchmark: false
verbose: true
update_sources: true
sources:
- http://gems.rubyforge.org/
- http://rubygems.org/
backtrace: true
@unflores
unflores / better-nodejs-require-paths.md
Created February 26, 2016 11:45 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@unflores
unflores / sidekiq
Last active December 25, 2015 12:19 — forked from dyerc/sidekiq
#!/bin/bash
# sidekiq Init script for Sidekiq
# chkconfig: 345 100 75
#
# Description: Starts and Stops Sidekiq message processor for Stratus application.
#
# User-specified exit parameters used in this script:
#
# Exit Code 5 - Incorrect User ID
# Exit Code 6 - Directory not found
@unflores
unflores / README.markdown
Created August 10, 2012 07:30 — forked from greypants/README.markdown
RAILS 3: nav_link helper for adding 'selected' class to navigation elements

#Behold, the nav_link:

The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.

For full usage details, see: http://viget.com/extend/rails-selected-nav-link-helper

Drop nav_link_helper.rb into app/helpers in your Rails 3.x app and enjoy.

@unflores
unflores / Capfile
Created February 24, 2011 21:51 — forked from nstielau/Capfile
Generic cap deploy script
#Generic cap deploy script
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
##################################
# Edit these
set :application, "example_node_app"
set :node_file, ""
set :host, "public_domain_name"
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "id_rsa")] #your private ssh key
set :repository, "git@githubrepo_url"