I hereby claim:
- I am lucaong on github.
- I am lucaongaro (https://keybase.io/lucaongaro) on keybase.
- I have a public key whose fingerprint is EFBB F8B2 E4B5 049F FF03 0B70 4F68 D2C9 63E1 2946
To claim this, I am signing this object:
| require 'rack' | |
| require 'benchmark' | |
| class OptimizedRackBuilder < Rack::Builder | |
| def call(env) | |
| @to_app ||= to_app | |
| @to_app.call(env) | |
| end | |
| end |
| require './tail_call_optimization' | |
| class Foo | |
| extend ::TailCallOptimization | |
| tailrec def fact(n, k = 1) | |
| raise ArgumentError, 'n should be >= 1' if n < 1 | |
| return k if n == 1 | |
| fact(n - 1, n * k) | |
| end |
| class Atom(T) | |
| @state : T | |
| @channel : Channel::Buffered({(T -> T), Channel::Buffered(T | ValidationError)}) | |
| @validator : T -> Bool | |
| def initialize(@state : T, @validator = ->(i : T){ true } : T -> Bool) | |
| @channel = Channel({(T -> T), Channel::Buffered(T | ValidationError)}).new(1) | |
| spawn do | |
| loop do | |
| block, c = @channel.receive |
I hereby claim:
To claim this, I am signing this object:
This gist quickly demonstrates my setup to allow multiple WiFi SSID/PSK to be configured at the same time on Nerves. It relies on NervesNetwork, which is a dependency. Currently, this is bound to the "wlan0" interface, but it can be made more generic with little effort.
In the nerves_network configuration, I omit setting "wlan0" (I want to take care of it myself).
| // Safari bug | |
| // ========== | |
| // | |
| // Two strings, that share a prefix after a regexp normalization, | |
| // are used as keys in an object. Then, they are traversed character | |
| // by character and recomposed into another string by concatenation, | |
| // and each is put in an array. When they are used to index the object, | |
| // the second one is not found among the keys: the reason is that it | |
| // contains a null byte (copy/paste it into a file and inspect the binary | |
| // representation, e.g. with `xxd`, to see that). |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Ore Trascorse</title> | |
| <style id="jsbin-css"> | |
| body { | |
| font-family: Helvetica, Arial, sans-serif; | |
| font-size: 16px; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Ore Trascorse</title> | |
| <style id="jsbin-css"> | |
| * { | |
| box-sizing: border-box; | |
| } |
| /** | |
| * Usage: | |
| * | |
| * import { and, or } from 'minisearch-combiner' | |
| * | |
| * and(resultsA, resultsB) | |
| * | |
| * or(resultsA, resultsB) | |
| * | |
| * and(or(resultsA, resultsB), resultsC) |