I went to brunch with a friend at 10:30am, took a car2go there, took an uber back b/c I had a few drinks. They called me at 7pm to tell me I hadn't ended my trip, and wouldn't b/c I had parked in the resturaunt's parking lot (I guess you're not allowed to do that). Walked 3 blocks in the cold rain to another car2go so I could get back there to end it, but the car was gone by the time I got there, so took another uber down to the car and drove it back. Paid attention this time: it gave me an "end trip" button, which I hit, it told me to put the key in the holder, I did, it sent my trip data to the server, and gave me a big splash screen saying "End Trip: turn off lights, apply parking break" I was like "wtf, that's what I did last time!" then, I noticed below all that, where I didn't notice it, it said I needed to flash my card against the reader outside the car again -.- $81 for that trip, plus the $10 uber, plus whatever they charge me to get back. Hopefully they'll realize that this is all a consequence of
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
# 2.9% + $0.30 per transaction - https://stripe.com/us/pricing | |
def cost_to_process_credit_cards(payments) | |
charges = payments.map { |a| a * 0.029 } + payments.map { 0.3 } | |
charges.inject(0, :+).round(2) | |
end | |
# $0.25 per transaction - https://gist.github.com/amfeng/897dde5a36b91530b99e | |
def cost_to_process_ach(payments) | |
payments.map { 0.25 }.inject(0, :+).round(2) | |
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
# looks like github highlights non-ascii characters, but they look normal in n editor | |
send def really⁉ | |
__method__ # => :really⁉ | |
end | |
send def kill_it_with_fire‼‼ | |
__method__ # => :kill_it_with_fire‼‼ | |
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
# Quick object model: | |
# classes = containers for methods | |
# objects = containers for instance variables | |
# You invoke the method on the object | |
# It looks it up in its class | |
# The method executes in the context of the object | |
# This gives it access to instance variables | |
# From the outside, you *CANNOT* access instance variables | |
# You can only invoke methods which have access to them |
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
var spawn = require('child_process').spawn; | |
var text = atom.workspace.activePaneItem.selectAll()[0].getText(); | |
ar rb = spawn("ruby", ['-e', 'puts $stdin.read.encoding'], {"env": process.env}); | |
rb.stdout.on("data", function(o) { console.log("STDOUT: "+o); }); | |
rb.stderr.on("data", function(o) { console.log("STDERR: "+o); }); | |
rb.stdin.write(text); | |
rb.stdin.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
require 'stringio' | |
File.open '/dev/null', 'w' do |black_hole| | |
$stdout = STDOUT = black_hole | |
puts 'Stdout goes into the black hole' | |
system 'echo but system still gets through... bug?' | |
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
# Classes are containers for methods | |
# Objects are containers for instance variables | |
# scopes are containers for local variables | |
# and execute in the context of an object | |
# When you call a method on an object | |
# it looks it up in the class | |
# if it doesn't find it there | |
# it continues looking it up in the chain of superclasses | |
# Module is a container for methods | |
# When you include it into a class |
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
require 'minitest/autorun' | |
require 'minitest/pride' | |
class FormatPhoneNumber | |
class BadNumberError < StandardError | |
end | |
def initialize(raw_number) | |
@raw_number = raw_number | |
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
Gemfile - Where you specify your dependencies | |
Gemfile.lock - Bundler resolved dependencies | |
your dependencies dependencies | |
and versions that match all the Gemfile's requirements | |
Readme - Text file about your project | |
Rakefile - Task runner | |
$ rake -T # see all tasks | |
$ rake db:create # run the db:create task | |
app/ | |
assets/ - resources that get run through the asset pipeline |