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
desc "Launch a Capybara session in a console" | |
task capyconsole: :environment do | |
require "capybara" | |
require "pry" | |
driver = case ENV.fetch('DRIVER', 'phantomjs') | |
when 'phantomjs' | |
require "capybara/poltergeist" | |
Capybara.register_driver :poltergeist_debug do |app| |
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
class FileAttachmentUploader < CarrierWave::Uploader::Base | |
storage :fog | |
end |
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
class From | |
attr_accessor :original | |
def initialize(object) | |
self.original = object | |
end | |
def id | |
"#{original.class}-#{original.id}" | |
end |
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
# Description: | |
# Everything is awesome. | |
# | |
# Configuration: | |
# HUBOT_LESS_EVERYTHINGISAWESOME | |
# | |
# Commands: | |
# awesome | team - reply with everything is awesome thing | |
module.exports = (robot) -> |
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
class Phrase | |
def initialize(value) | |
@phrase = value | |
end | |
def word_count | |
Hash.new(0).tap do |count| | |
phrase_words.each do |word| | |
count[word.downcase] += 1 | |
end |
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
class Phrase | |
def initialize(value) | |
@phrase = value | |
end | |
def word_count | |
Hash.new(0).tap do |count| | |
@phrase.split(/[^[:alnum:]]+/).each do |word| | |
count[word.downcase] += 1 | |
end |
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
class Bob | |
def hey(input) | |
input = Input.new(input) | |
if input.blank? | |
'Fine. Be that way.' | |
elsif input.shouting? | |
'Woah, chill out!' | |
elsif input.question? | |
'Sure.' | |
else |
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
I, [2013-08-19T12:53:56.685125 #90466] INFO -- : SOAP request: http://ec2e-gf-n1.connexon.com:28080/ConnexonProprietaryLocation_Service/LocationConnexonWS?wsdl | |
I, [2013-08-19T12:53:56.685192 #90466] INFO -- : SOAPAction: "AddLocationComplete", Content-Type: text/xml;charset=UTF-8, Content-Length: 979 | |
D, [2013-08-19T12:53:56.685470 #90466] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?> | |
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://service.administration.connexon.com/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> | |
<env:Body><tns:AddLocationComplete><authentication> | |
<accountID>BD721DDD-7FCB-4624-9263-708ABE68DA70</accountID> | |
<authenticationToken>EE2F9882-B394-4696-A068-0A9BD58ED9FD</authenticationToken> | |
</authentication> | |
<addressData> |
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
TWITTER_LINKS = /twitter\.com\/([\w\/]*)/ | |
usernames = File.open('email.txt', 'r').readlines.map do |line| | |
matches = line.scan(TWITTER_LINKS).flatten | |
end.compact.flatten | |
['mileszs', '_swanson'].each { |n| usernames.delete(n) } | |
puts "... content from #{usernames.join(', ')}" |
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 | |
hits = [] | |
checks = { | |
#'_spec\.rb$' => ['focus:[:space:]*true'], | |
'\.rb$' => ['binding\.pry', 'debugger'] | |
} | |
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified | |
filenames = `git diff --cached --name-only --diff-filter=ACM`.split("\n") |