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 assume that the bot user is already in some channel. | |
In my case I had the bot invited to #bot-test in a slack I have admin privileges for. | |
$ SLACK_API_KEY=xoxb-XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXX ruby test-slack.rb |
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
# How do we even node? | |
A story of us trying to node: | |
1. Use node's debugger to interact with a test spec running under jasmine-node | |
$ node debug /Users/username/.nvm/versions/node/v4.1.1/lib/node_modules/jasmine-node/lib/jasmine-node/cli.js hamming_test.spec.js | |
Note: debugger is in hamming.js but debugger could also be in cli.js, | |
hamming_test.spec.js, or any other file that is loaded. |
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
accomplished | |
aggravated | |
amused | |
angry | |
annoyed | |
anxious | |
apathetic | |
artistic | |
awake | |
bitchy |
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 @Reloader | |
constructor: (@selector = '.wrapper', @path, @interval = 2000) -> | |
@start() | |
start: => | |
@timer = setInterval(@fetch, @interval) | |
stop: => | |
clearInterval(@timer) |
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
// IE9 must have onprogress be set to a unique function. | |
xhr.onprogress = function () { | |
// IE must die | |
} | |
// hate IE | |
xhr.ontimeout = noop |
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
$ git push heroku master | |
Initializing repository, done. | |
Counting objects: 60, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (49/49), done. | |
Writing objects: 100% (60/60), 14.23 KiB | 0 bytes/s, done. | |
Total 60 (delta 2), reused 0 (delta 0) | |
-----> Ruby app detected | |
-----> Compiling Ruby/Rails |
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
AWS.config(access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'] ) | |
S3_BUCKET = AWS::S3.new.buckets[ENV['S3_BUCKET']] |
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
def public_setters | |
public_methods.select{|method| method =~ /=$/ }.delete_if{|method| %i(== === !=).include?(method)} | |
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
desc "Running all the benchmarks and writing results to file" | |
task :benchmark do | |
STDOUT.puts("Benchmarking:") | |
Dir[File.join(File.dirname(__FILE__), "bench", "**", "*.rb")].each do |benchmark| | |
STDOUT.puts <<-DOCUMENT | |
--- | |
file: #{benchmark} | |
platform: #{RUBY_DESCRIPTION} | |
timestamp: #{Time.now} | |
results: | |
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
# config/routes.rb | |
resources :documents do | |
resources :versions, controller: "documents/versions" do | |
post :restore, on: :member | |
end | |
resource :lock, controller: "documents/locks" | |
end | |