This file contains 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
defmodule Zurg do | |
import Enum | |
@toys %{buzz: 5, woody: 10, rex: 20, hamm: 25} | |
def solve() do | |
initial_state | |
|> complete_sequences | |
|> pick_fastest | |
end |
This file contains 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
alias ErlangFactory.MexicoCity2015.Repo | |
Repo.all Attendee | |
|> share | |
|> learn | |
|> make_friends | |
|> have_mezcal | |
|> have_fun |
This file contains 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
# Requires pythonpy | |
cat numbers | py --ji -l 'min(l), max(l), numpy.median(l), numpy.mean(l)' |
This file contains 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
base_url="http://elixir-lang.org/docs/stable/elixir/" | |
curl "${base_url}/modules_list.html" > modules.html | |
grep '<a href' modules.html | grep -v '#' | \ | |
awk '{print $2}' | sed -e 's/href=\"//g' -e 's/\.html\".*//g' | \ | |
tail +3 > modules.txt | |
for m in `cat modules.txt`; do | |
curl "${base_url}/${m}.html" > "${m}.html"; |
This file contains 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
#!/usr/bin/env ruby | |
require 'ostruct' | |
require 'fuzzy_match' | |
file_name = ARGV[0] || 'names.txt' | |
threshold = ARGV[1].to_i || 0.7 | |
strs = File.readlines(file_name).collect {|s| s.strip } | |
matches = strs.collect{|s| |
This file contains 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
build_number = build.buildVariableResolver.resolve('PARENT_BUILD_NUMBER') | |
compile_job = build.buildVariableResolver.resolve('COMPILE_JOB_NAME') | |
println("Build number: ${build_number}") | |
println("Compile job: ${compile_job}") | |
PackagePath = "C:\\Jenkins\\jobs\\" | |
RutaLog = "$PackagePath\\$compile_job\\builds\\$build_number\\log" | |
println("Ruta log: ${RutaLog}") |
This file contains 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
file = new File(args[0]) | |
board = [][] | |
file.eachWithIndex {obj, i -> | |
if (i == 0) { | |
(rows, columns) = obj.split(" ")*.toInteger() | |
} else { | |
board << ([0] << obj.collect{ it == '*'?'*':0 } << [0]).flatten() | |
} | |
} |
This file contains 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
import Window | |
import Graphics.Collage | |
middle (x,y) (x',y') = ((x + x') / 2, (y + y') / 2) | |
distance (x,y) (x',y') = sqrt <| (x' - x) ^ 2 + (y' - y) ^ 2 | |
trisect (x,y) (x',y') = | |
let (dx, dy) = ((x' - x) / 3, (y' - y) / 3) | |
in ((x + dx, y + dy), (x + 2 * dx, y + 2 * dy)) |
This file contains 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
import Window | |
import Graphics.Collage | |
import Random | |
import Text | |
import Signal | |
radius = 30 | |
lineWidth = 3 | |
bubbleAlpha = 0.4 |
This file contains 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
import Window | |
import Random | |
import Text | |
radius = 30 | |
lineWidth = 3 | |
bubbleAlpha = 0.4 | |
-- Util |