This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "<box name>" | |
# Create port fowarding between guest and host | |
config.vm.network "forwarded_port", guest: 3000, host: 3000 | |
config.vm.network "forwarded_port", guest: 80, host: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new # guest user (not logged in) | |
if user.has_role? :admin | |
can :manage, :all | |
elsif user.has_role? :user | |
can :read, :all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Trick WordPress into thinking that www.example.com is example.com | |
RequestHeader edit Host "^www\.(.*)$" "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ | |
"keys": ["control+alt+;"], "command": "align_tab", | |
"args" : { | |
"user_input" : ":/f", | |
} | |
}, | |
{ | |
"keys": ["control+alt+:"], "command": "align_tab", | |
"args" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bootstrap_tab_bookmark (selector) { | |
if (selector == undefined) { | |
selector = ""; | |
} | |
var bookmark_switch = function () { | |
url = document.location.href.split('#'); | |
if(url[1] != undefined) { | |
$(selector + '[href=#'+url[1]+']').tab('show'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CarrierWave.configure do |config| | |
if Rails.env.development? or Rails.env.test? | |
config.storage = :file | |
else | |
config.fog_credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => '<access key>', | |
:aws_secret_access_key => '<secrect acess key >' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ishouvik::Application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# Code is not reloaded between requests. | |
config.cache_classes = true | |
# Eager load code on boot. This eager loads most of Rails and | |
# your application in memory, allowing both thread web servers | |
# and those relying on copy on write to perform better. | |
# Rake tasks automatically ignore this option for performance. |