Language website: https://elixir-lang.org/
❤ conventions over configuration Framework website: https://www.phoenixframework.org/ Docs: https://hexdocs.pm/phoenix/overview.html
require 'tempfile' | |
require 'bundler/inline' | |
require 'date' | |
gemfile do | |
source 'https://rubygems.org' | |
ruby '3.3.0' | |
gem 'pdftotext', require: true | |
gem 'pry', require: true | |
end |
Language website: https://elixir-lang.org/
❤ conventions over configuration Framework website: https://www.phoenixframework.org/ Docs: https://hexdocs.pm/phoenix/overview.html
INPUT = [ | |
1,12,2,3, | |
1,1,2,3, | |
1,3,4,3, | |
1,5,0,3, | |
2,10,1,19, | |
1,5,19,23, | |
1,23,5,27, | |
1,27,13,31, | |
1,31,5,35, |
# frozen_string_literal: true | |
input = [ | |
51_360, 95_527, 72_603, 128_601, 68_444, 138_867, 67_294, | |
134_343, 62_785, 53_088, 134_635, 137_884, 97_654, 103_704, | |
138_879, 87_561, 83_922, 68_414, 84_876, 105_143, 76_599, | |
98_924, 57_080, 63_590, 50_126, 111_872, 55_754, 64_410, | |
78_488, 56_557, 105_446, 127_182, 59_451, 87_249, 61_652, | |
131_698, 148_820, 95_742, 68_223, 121_744, 65_678, 99_745, | |
64_089, 75_610, 106_085, 100_364, 116_959, 122_862, 56_580, |
I hereby claim:
To claim this, I am signing this object:
file = File.open("/path/to/file.md", "r").each_line | |
header = file.take(2) | |
title = header.join.gsub(/\W/,"") | |
groups = file.slice_when { |line| line.chomp == "---" }.to_a | |
sorted = groups.sort_by { |(line, *_)| line.downcase.match(/\[(.*)\]/).to_s.gsub(/\W/,"") } | |
BANNER = proc do |title, vowel| | |
%Q<## Alphabetical index of projects in #{title}: | |
| | | | | | | | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
If you have been reading blog posts, hacker news threads, your favorite developers tweets or listening podcasts at this point I'm pretty sure you heard about Elixir programming language. The language was created by José Valim, a well known developer in the open-source world, you probably know him from the Ruby on Rails MVC framework or from the devise and simple_form ruby gems him and his co-workers from the Plataformatec have been working in the last years.
According the José Valim, the language was born 2011. He had the idea to build the new language due the lack of good tools to solve the concurrency problems in the ruby world. At that time, after spending time studying concurrency and distributed focused languages he found two languages that he likes Erlang and Clojure which runs in the JVM. He liked everything he saw in the Erlang language (Erlang VM) and he hated the things he didn't see, like polymorphism, metaprogramming and languag
module IntegrationSpecHelper | |
def drop_files files, drop_area_id | |
js_script = "fileList = Array();" | |
files.count.times do |i| | |
# Generate a fake input selector | |
page.execute_script("if ($('#seleniumUpload#{i}').length == 0) { seleniumUpload#{i} = window.$('<input/>').attr({id: 'seleniumUpload#{i}', type:'file'}).appendTo('body'); }") | |
# Attach file to the fake input selector through Capybara | |
attach_file("seleniumUpload#{i}", files[i]) | |
# Build up the fake js event | |
js_script = "#{js_script} fileList.push(seleniumUpload#{i}.get(0).files[0]);" |