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
def authorize!(action, resource) | |
if ::Ability.new(current_user).cannot?(action, resource) | |
return_error('permission.not_authorized', 403) | |
end | |
end |
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
" Move between panes using ctrl-hjkl | |
map <C-h> <C-w>h | |
map <C-j> <C-w>j | |
map <C-k> <C-w>k | |
map <C-l> <C-w>l |
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
return false if invalid_auth? | |
user.account.authentication_token = AuthToken.generate | |
user.save | |
AuthToken.refresh!(user.account) | |
def refresh!(account) | |
ActiveRecord::Base.transaction do | |
do_stuff | |
account.save |
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
controllers/admin/users/index -> AdminUsersIndex | |
controllers/admin/users/edit -> AdminUsersEdit | |
controllers/admin/device/index | |
controllers/admin/device/edit | |
templates/admin/users/index.html | |
templates/admin/users/edit.html | |
controllers/welcome |
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
def import_hilton_services | |
create :category, codename: :personal | |
path = 'db/seeds/computed_services/hilton_client_status' | |
ServiceImporter.new(path).import | |
ServiceSpecificationImporter.new(path).import | |
ParameterImporter.new(path).import | |
end |
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
module APIHelper | |
def api(version = 'v1') | |
"/api/#{version}" | |
end | |
def post(url, *args) | |
process_request_args(args) | |
super(url, *args) | |
end |
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
" Hugo Ribeira | |
" Vundle {{{ | |
set nocompatible " be iMproved, required | |
filetype off " required for vundle | |
set rtp+=~/.nvim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' " required for vundle to work |
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
[push] | |
default = current | |
[color] | |
ui = auto | |
[alias] | |
aa = add --all | |
ap = add --patch | |
cm = commit -m | |
ci = commit -v | |
co = checkout |
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
Host test-worker | |
port 22 | |
hostname 192.168.0.131 | |
user deploy | |
proxycommand ssh deploy@dev-org3-bastion.nourishcare.co.uk -W %h:%p | |
Host bet | |
hostname 34.250.62.3 | |
user ubuntu | |
port 22 | |
Host beta-web |
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
map <leader>vr :set cursorcolumn!<Bar>set cursorline!<CR> |