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
``` | |
#!/bin/sh | |
echo "\nRunning Rubocop 🚓 💨 💨 💨\n" | |
declare -a ERRORS=() | |
for file in $(git diff --cached --name-only | grep -E '.rb') | |
do | |
ERRORS+=("$(rubocop $file | grep -e 'C:' -e 'E:')") | |
done |
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 Pipeline | |
def self.run | |
new.run | |
end | |
def run | |
# do stuff | |
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
#!/bin/bash | |
INFO='\033[1;32m' | |
NC='\033[0m' | |
GNUPG_DIR="$HOME/.gnupg" | |
function info() { | |
echo -e "${INFO}$1${NC}" | |
} |
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
<form class="tab-content"> | |
<div class="tab-pane fade show active" id="wizardStepOne" role="tabpanel" aria-labelledby="wizardTabOne"> | |
Step 1 | |
<div class="row align-items-center mt-4"> | |
<div class="col-auto"> | |
<button class="btn btn-lg btn-white" type="reset">Cancel</button> | |
</div> | |
<div class="col text-center"> |
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 Merge | |
class Base | |
attr_accessor :base, :compare | |
def initialize(base, compare) | |
@base = base | |
@compare = compare | |
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
already_booked = [ | |
Event.new('2018-12-19 16:00:00', '2018-12-19 17:00:00'), | |
Event.new('2018-12-20 9:00:00', '2018-12-20 10:00:00') | |
] | |
available = [ | |
Event.new('2018-12-19 16:00:00', '2018-12-19 17:00:00'), | |
Event.new('2018-12-20 9:30:00', '2018-12-20 11:30:00'), | |
Event.new('2018-12-21 9:00:00', '2018-12-20 11:00:00') | |
] |
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
s.events = s.events.map { |e| e.end_date = e.end_date + 1.second } |
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
stubPromise = () => new Em.RSVP.Promise(() => {}); | |
promise_1 = Em.RSVP.defer({ promise: stubPromise() }); | |
promise_2 = Em.RSVP.defer({ promise: stubPromise() }); | |
promise_1.promise.then(() => console.warn(1, moment().valueOf())); | |
promise_2.promise.then(() => console.warn(2, moment().valueOf())); | |
moment().valueOf(); promise_1.resolve(); promise_2.resolve(); |
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
done = (msg, delay) => { | |
console.warn(msg, delay); | |
return msg; | |
}; | |
p = (msg, delay) => new Em.RSVP.Promise((resolve) => Em.run.later(() => resolve(done(msg, delay)), delay) ); | |
fast = [p('fast one', 3223), p('fast two',3509)]; | |
slow = [p('slow one', 15523), p('slow two', 15509)]; |
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
const sum = (arr) => arr.reduce((a, b) => a + b); | |
const average = (arr) => sum(arr)/arr.length; | |
kms = $(".feature-title:contains('Odometer')").next('div').text().split(' km').filter(k => k.length).map(k => parseInt(k.replace(',', ''))); | |
prices = $('.ad-price .price').text().split('$').filter(p => p.length).map(p => parseInt(p.replace(',', ''))); | |
avKms = average(kms); | |
avPrice = average(prices); | |
pricePerKm = avPrice/avKms; |
NewerOlder