This file contains hidden or 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
| module RedisHelper | |
| # decode Redis value back to Ruby object | |
| def self.decode(json) | |
| self.new(ActiveSupport::JSON.decode(json)["#{self.name.downcase}"]) | |
| end | |
| # encode Ruby object for Redis | |
| def encoded | |
| self.updated_at = nil | |
| self.to_json |
This file contains hidden or 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 Admin::UsersController < ApplicationController | |
| before_filter :authenticate_user! | |
| before_filter :check_if_admin | |
| include Pundit | |
| def index | |
| @users = User.all | |
| end | |
| def update |
This file contains hidden or 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
| source 'https://rubygems.org' | |
| # default gems here | |
| #--------------------------- | |
| # add paperclip and bootstrap | |
| gem "paperclip", "~> 4.1" | |
| gem 'bootstrap-sass', '~> 3.1.1' |
This file contains hidden or 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
| sudo chown -R `whoami` /usr/local | |
| cd /usr/local | |
| git reset --hard origin/master | |
| brew doctor |
This file contains hidden or 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
| echo "export PATH=$PATH:/Users/iqbalhasnan/.rvm/gems/ruby-1.9.3-p550/bin" >> ~/.bash_profile |
This file contains hidden or 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
| git config --local --unset gui.geometry |
This file contains hidden or 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
| lsof -wni tcp:PORT | |
| kill -9 PID |
This file contains hidden or 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
| rvm use --create —ruby-version 1.9.3-p550@wrapper |
This file contains hidden or 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
| This gist is the update of this post https://u.osu.edu/hasnan.1/2014/03/30/rails-4-multiple-file-upload-with-carrierwave-nested-form-and-jquery-file-upload/ | |
| License MIT |