I hereby claim:
- I am temochka on github.
- I am achistyakov (https://keybase.io/achistyakov) on keybase.
- I have a public key whose fingerprint is 7847 35BD F6BD FFDC 2132 2837 C8A3 DEB2 CE53 62C6
To claim this, I am signing this object:
| module OptimizedSolution where | |
| import Control.Monad | |
| import Data.List | |
| import Data.Array | |
| import Data.Char | |
| readToken :: IO String | |
| readToken = do | |
| ch <- getChar | |
| lex ch |
I hereby claim:
To claim this, I am signing this object:
| require 'securerandom' | |
| require 'fileutils' | |
| NUM_FILES = 35000 | |
| NUM_DIRECTORIES = 5000 | |
| NAME_LENGTH = 100 | |
| MAX_DIR_DEPTH = 10 | |
| MAX_FILES_PER_DIR = 100 | |
| MAX_DIRS_PER_DIR = 100 |
| class EmailBatch | |
| attr_reader :messages | |
| delegate :<<, to: :messages | |
| def initialize(messages = []) | |
| @messages = messages | |
| end | |
| def deliver_now |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "Stmt1422638998000", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "cloudfront:CreateInvalidation", | |
| "cloudfront:GetDistribution" | |
| ], |
| require 'mail' | |
| msg = Mail.new { body 'Text' } | |
| # => #<Mail::Message:70116771523620, Multipart: false, Headers: > | |
| msg.text? | |
| # => false | |
| puts msg | |
| # Date: Sun, 21 Dec 2014 01:29:26 -0500 | |
| # Message-ID: <549668c6e2caa_33e13fc554c65be84831f@Artems-MacBook-Pro.local.mail> | |
| # Mime-Version: 1.0 |
| -module(euler). | |
| -compile(export_all). | |
| %% 1 | |
| %% Find the sum of all the multiples of 3 or 5 below 1000. | |
| problem1() -> | |
| lists:sum([I || I <- lists:seq(0,999), I rem 3 =:= 0 orelse I rem 5 =:= 0]). | |
| %% 2 |
| (import '[java.util Random]) | |
| (def ^:const seed 42) | |
| (def ^Random shuffler (Random. seed)) | |
| (def alphabet (->> "abcdefghijklmnopqrstuvwxyz0123456789" | |
| (sort-by (fn [_] (.nextInt shuffler))) | |
| vec)) | |
| (def N (count alphabet)) | |
| (defn pack-number | |
| ([n] (pack-number n "")) | |
| ([n buf] |
| require 'mail' | |
| require 'postmark' | |
| client = Postmark::ApiClient.new('xxxx-xxxx-xxxx-xxxx') | |
| bounce = client.get_bounces(offset: 0, count: 1).first | |
| dump = client.dump_bounce(bounce[:id]) | |
| msg = Mail::Message.new(dump[:body]) | |
| headers = Hash[*msg.header.fields.flat_map { |f| [f.name, f.value] }] | |
| # => {"Return-Path"=>"", "Date"=>"Tue, 29 Jul 2014 05:50:48 -0400", "From"=>"", "To"=>"", "Message-ID"=>"", "Subject"=>"Delivery report", "Mime-Version"=>"1.0", "Content-Type"=>"multipart/report; report-type=delivery-status; boundary=\"\"", "Content-Transfer-Encoding"=>"7bit", "X-Your-Custom-Header"=>"Value"} |
| class TestMailer < ActionMailer::Base | |
| def email | |
| headers['X-Tag-Via-Hash-Access'] = 'value' | |
| headers 'X-Tag-Via-Headers-Method' => 'value' | |
| mail(to: '[email protected]', from: '[email protected]', subject: 'Headers test') do |format| | |
| format.text { render text: 'Headers test' } | |
| end |