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
define [ | |
'underscore' | |
], (_) -> | |
Object.defineProperty Error.prototype, 'toJSON', | |
configurable: true | |
value: -> | |
json = {} | |
Object.getOwnPropertyNames(this).forEach (prop) => | |
if this[prop] instanceof Error |
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
set-option -g default-command "reattach-to-user-namespace -l zsh" | |
# Use vim bindings to navigate | |
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" | |
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" | |
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" | |
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" | |
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -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
if DEBUG: | |
# will output to your console | |
logging.basicConfig( | |
level = logging.DEBUG, | |
format = '%(asctime)s %(levelname)s %(message)s', | |
) |
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
## in rating.rb | |
# not the best method name.. | |
# call it with name.rat1.display_rating | |
def display_rating | |
read_attribute(:rating).presence || "N/A" | |
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
# use on its own | |
<%= create_modal("modal","Modal Header", render("modal")) %> | |
# or as part of another helper | |
def modal_link_with_modal | |
modal_id = "modal" | |
link_to("Modal", "##{modal_id}", :data => { :toggle => "modal" }) + | |
create_modal(modal_id, "Modal Header", render("modal"), true) | |
end |