Skip to content

Instantly share code, notes, and snippets.

# Description:
# Everything is awesome.
#
# Configuration:
# HUBOT_LESS_EVERYTHINGISAWESOME
#
# Commands:
# awesome | team - reply with everything is awesome thing
module.exports = (robot) ->
class From
attr_accessor :original
def initialize(object)
self.original = object
end
def id
"#{original.class}-#{original.id}"
end
class FileAttachmentUploader < CarrierWave::Uploader::Base
storage :fog
end
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|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>409</string>
<key>AMApplicationVersion</key>
<string>2.5</string>
<key>AMDocumentVersion</key>
<string>2</string>
@mileszs
mileszs / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mileszs
mileszs / Gemfile
Created April 9, 2015 13:44
Code Scot, Steve, Ross, and Miles wrote at Indy.rb, April 2015
source 'https://rubygems.org'
gem 'grape'
@mileszs
mileszs / gist:3c670301aa8e99fca538
Last active August 29, 2015 14:18
Here are links of note from Indy.rb's Hack an API night (April 2015)
def duplicate_keys(ary)
duplicates(ary).keys
end
def duplicates(ary)
count_values(ary).select { |_, count| count > 1 }
end
def count_values(ary)
ary.inject({}) { |memo, value| memo[value] = memo[value].to_i + 1; memo }
# Enable .htaccess Files
# Place something like the following in your Apache configuration file,
# or your virtual host configuration file.
<Directory /home/billstemp/public_html/>
Options Indexes FollowSymLinks MultiViews
# THIS is the most important line
AllowOverride All
Order allow,deny