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
#!/usr/bin/env ruby | |
# | |
# Git commit-msg hook adapted from Henrik Nyh's <http://henrik.nyh.se> original version | |
# <https://gist.github.com/184711> | |
# | |
# Works in tandem with the redmine_stagecoach gem to automatically add your | |
# branch's associated github issue number to your commit message. | |
# | |
# If you include "#noref" in the commit message, nothing will be added to | |
# the commit message, and the "#noref" itself will be stripped. |
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
# Calculates billable day-of-month numbers at the end | |
# of a month with fewer than 31 days. | |
# | |
# eg. billable_days Date.new(2012, 02, 29) => 29, 30, 31 | |
# | |
def billable_days(date = Date.today) | |
if date.day == date.end_of_month.day | |
(date.day..31) | |
else | |
date.day |
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
java -jar /usr/local/Cellar/selenium-server-standalone-grid/2.32.0/selenium-server-standalone-2.32.0.jar -p 4444 -role hub |
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
# Show euro total when editing account payment plans | |
$(".input .integer[id^='account_payment_plans_attributes']").each -> | |
value = $(@).attr('value') / 100 / 1000 | |
$(@).parent().next('.euros').html(" = €#{$(@).attr('value') / 100 / 1000 }") | |
$(".input .integer[id^='account_payment_plans_attributes']").on 'keyup', -> | |
$(@).parent().next('.euros').html(" = €#{$(@).attr('value') / 100 / 1000 }") |
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
" Oli new stuff | |
" ==================================== | |
" Press space in normal mode to enter a command | |
nnoremap <Space> : | |
" Pretty lines | |
set fillchars=vert:\ | |
" make backspace work like most other apps | |
set backspace=2 |
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
#!/usr/bin/env ruby | |
# Monty Hall problem proof http://en.wikipedia.org/wiki/Monty_Hall_problem | |
module Monty | |
PLAYERS_WITH_POLICY = { jimmy: :switch, jasper: :stick, johnson: :random } | |
DOORS = [:goat, :goat, :ferrari] | |
COUNT = Integer(ARGV[0] || 100000) | |
class << self | |
def win?(policy) | |
doors = DOORS.dup.shuffle |
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 ElegantLog | |
extend ActiveSupport::Concern | |
def elegant_log(params, display_name = nil) | |
return if params.blank? | |
spacer | |
Rails.logger.info display_name || params.delete(:controller).titleize | |
longest_length = params.keys.sort {|k1, k2| k2.length <=> k1.length}.first.length |
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
Error detected while processing function targets#o[8]..<SNR>67_findTarget[8]..<SNR>67_findRawTarget[15]..<SNR>67_quoteDir: | |
line 7: | |
E121: Undefined variable: col: | |
E15: Invalid expression: line[col:] | |
line 12: | |
E121: Undefined variable: right | |
E116: Invalid arguments for function s:count(s:opening, right) | |
E15: Invalid expression: s:count(s:opening, right) | |
line 16: | |
E121: Undefined variable: rc |
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
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 19 2015 14:48:49) | |
MacOS X (unix) version | |
Included patches: 1-922 | |
Compiled by Homebrew | |
Huge version without GUI. Features included (+) or not (-): | |
+acl +farsi +mouse_netterm +syntax | |
+arabic +file_in_path +mouse_sgr +tag_binary | |
+autocmd +find_in_path -mouse_sysmouse +tag_old_static | |
-balloon_eval +float +mouse_urxvt -tag_any_white | |
-browse +folding +mouse_xterm -tcl |
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
Show hidden characters
{ | |
"presets": ["react-native", "flow", "react-native-dotenv"], | |
"plugins": [ | |
"react-hot-loader/babel", | |
[ | |
"module-resolver", | |
{ | |
"root": ["../../"], | |
"alias": { | |
"src": "./src" |
OlderNewer