Skip to content

Instantly share code, notes, and snippets.

Avatar

Omar Ramos omarramos

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am omarramos on github.
  • I am omarramos (https://keybase.io/omarramos) on keybase.
  • I have a public key whose fingerprint is 8EEC A272 46AC 45B8 401A C85C 1464 E21B 35A2 B409

To claim this, I am signing this object:

View gist:4a9b6a66092d09e9256f

TODO: make gem for this

This was tested using Rails 3.2 and Rails 4.0 on Ruby 2.0.0.

Bower

  1. Set the install directory for Bower components:

    // .bowerrc
@omarramos
omarramos / gist:1707067
Created Jan 30, 2012 — forked from moiristo/gist:1245170
Rails3 way to redirect non-www domain to www domain
View gist:1707067
# Rails3 way to redirect non-www domain to www domain
# Single domain redirect
'example.com'.tap do |host|
constraints(:host => host) do
root :to => redirect {|params, req| URI.escape(req.query_string.present? ? "#{req.protocol}www.#{host}?#{req.query_string}" : "#{req.protocol}www.#{host}") }
match '/*path', :to => redirect {|params, req| URI.escape(req.query_string.present? ? "#{req.protocol}www.#{host}/#{params[:path]}?#{req.query_string}" : "#{req.protocol}www.#{host}/#{params[:path]}") }
end
end
@omarramos
omarramos / nginx
Created Jan 22, 2012
Modified Nginx init scrip to work with default nginx passenger module instalation path
View nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu or other *nix.
# Description: nginx init.d dash script for Ubuntu or other *nix.
### END INIT INFO
@omarramos
omarramos / backbone.rails.js
Created May 5, 2011 — forked from trydionel/backbone.rails.js
Makes Backbone.js play nicely with default Rails setup
View backbone.rails.js
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
@omarramos
omarramos / rtm_badges.user.js
Created Mar 26, 2011
Displays a dock badge for items in a certain Remember The Milk list.
View rtm_badges.user.js
// ==UserScript==
// @name Due Badge
// @namespace http://fluidapp.com
// @description Displays a dock badge for items in a certain Remember The Milk list.
// @include *
// @author Edd Morgan <trquadrant.com>
// ==/UserScript==
(function () {
if (window.fluid) {
You can’t perform that action at this time.