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 | |
file = 'helm/glide.lock' | |
require 'yaml' | |
lockfile = YAML.load_file(file) | |
# Obtained via `go get -v #{url}`, looking for 'found meta tag get.metaImport' | |
REPLACED_REPOS = { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{ | |
"basics" : { | |
"location" : { | |
"city" : "Wrocław", | |
"countryCode" : "PL" | |
}, | |
"name" : "Łukasz Czapliński", | |
"label" : "Web Developer / Architect", | |
"email" : "lukasz@czaplin.ski", | |
"summary" : "I'm a fullstack with a focus on delivering & evolving products, not simply building features according to schedule. I'm open to working both remotely and on-site.", |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 JasonChannelSerializer do | |
@behaviour Phoenix.Transports.Serializer | |
require Protocol | |
alias Phoenix.Socket.{Message, Broadcast, Reply} | |
Protocol.derive(Jason.Encoder, Message) | |
Protocol.derive(Jason.Encoder, Reply) | |
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
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"log" | |
"net" | |
"net/http" | |
"strings" |
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
let exchange (a : int, b : int) : Move = | |
fun circle -> | |
let valA = circle.[a] in | |
circle.[a] <- circle.[b]; | |
circle.[b] <- valA; | |
circle | |
let partner (a : char, b : char) : Move = | |
fun circle -> | |
let idxA = Array.findIndex ((=) a) circle in |
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
> Dancers.solve Dancers.input | |
val it : System.String = "olgejankfhbmpidc" |
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
let partner (a : char, b : char) : Move = | |
let swap (a, b) = (b, a) in | |
let toKV arr = Map.ofArray (Array.map swap (Array.indexed arr)) | |
let ofKV map = Array.map snd (Array.sortBy fst (Array.map swap (Map.toArray map))) in | |
let withKV f arr = ofKV(f (toKV arr)) in | |
withKV (fun kv -> | |
let valA = (Map.find a kv) in | |
let valB = (Map.find b kv) in | |
Map.add b valA (Map.add a valB kv)) |
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
> Dancers.partner ('e', 'p') Dancers.startingPattern | |
val it : Dancers.Circle = | |
[|'a'; 'b'; 'c'; 'd'; 'p'; 'f'; 'g'; 'h'; 'i'; 'j'; 'k'; 'l'; 'm'; 'n'; 'o'; 'e'|] |
NewerOlder