FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| $capture = $ ".capture" | |
| $capture.change (event) -> | |
| file = @files[0] | |
| event.preventDefault() | |
| # Capture first frame of video | |
| video = document.createElement("video") | |
| video.src = URL.createObjectURL(file) | |
| video.style.visibility = "hidden" |
| <Notification> | |
| <NotificationMetaData> | |
| <NotificationType>AnyOfferChanged</NotificationType> | |
| <PayloadVersion>1.0</PayloadVersion> | |
| <UniqueId>14baf090-6a81-4d13-b1ad-340363d569d8</UniqueId> | |
| <PublishTime>2014-02-23T11:35:40.497Z</PublishTime> | |
| <SellerId>MERCHANT_ID_1</SellerId> | |
| <MarketplaceId>A2EUQ1WTGCTBG2</MarketplaceId> | |
| </NotificationMetaData> | |
| <NotificationPayload> |
| class Hash | |
| def dig(key) | |
| each.find do |k, v| | |
| return v if k == key | |
| v.dig(key) if v.is_a?(Hash) | |
| end | |
| end | |
| end |
| #!/bin/bash | |
| for i in {1..4} | |
| do | |
| for ITS in start stop | |
| do | |
| say "$ITS programming, motherfucker." | |
| [[ $ITS = start ]] && sleep 1500 || sleep 300 | |
| done | |
| done |
| require 'jeff' | |
| module MWS | |
| class Request | |
| include Jeff | |
| HOSTS = { | |
| 'A2EUQ1WTGCTBG2' => 'mws.amazonservices.ca', | |
| 'AAHKV2X7AFYLW' => 'mws.amazonservices.com.cn', | |
| 'A1PA6795UKMFR9' => 'mws-eu.amazonservices.com', |
| require 'benchmark' | |
| require './lib/excon' | |
| include Excon | |
| uris = { | |
| 'Good URI' => "http://example.org/#{'foo/' * 10}?#{10.times.map { 'bar=baz' }.join('&')}", | |
| 'Bad URI' => "http://example.org/#{'foo /' * 10}?#{10.times.map { 'bar=baz' }.join('&')}" | |
| } |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| #!/usr/bin/env bash | |
| curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
| mkdir vim && tar xzvf vim.tar.gz -C vim | |
| export PATH=$PATH:/app/vim/bin |
| #!/usr/bin/ruby -w | |
| require 'digest/md5' | |
| filename = 'MD5.rdoc' | |
| all_digest = Digest::MD5.hexdigest(File.read(filename)) | |
| incr_digest = Digest::MD5.new() | |
| file = File.open(filename, 'r') | |
| file.each_line do |line| | |
| incr_digest << line |
| # config/initializers/sidekiq.rb | |
| if Sidekiq.server? | |
| config = ActiveRecord::Base.connection.pool.spec.config | |
| ActiveRecord::Base.establish_connection(config.merge(pool: Sidekiq.options.fetch(:concurrency))) | |
| end |