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 | |
# encoding: utf-8 | |
CHARS = %w{ } | |
def encode(string) | |
string.chars.map{|c|"#{CHARS[c[0]/16]}#{CHARS[c[0]%16]}"}.join | |
end | |
program = <<-EOF |
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
class Symbol | |
def | other | |
-> arg { other.to_proc[arg.send(self)] } | |
end | |
def call(*args) | |
-> arg { arg.send(self, *args) } | |
end | |
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
#!/usr/bin/env ruby | |
# Parts stolen with no regret from Homebrew's OpenSSL formula. | |
require 'fileutils' | |
require 'openssl' | |
require 'digest/md5' | |
require 'digest/sha1' | |
CERT_FILE = ENV.fetch('SSL_CERT_FILE', '/usr/local/etc/openssl/cert.pem') |
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
dpyNullary[ex_] := | |
Grid[{{ex, ""}}, | |
Frame -> {All,False}, | |
Alignment -> Left, | |
Background -> {{LightOrange,{LightYellow}}}]; | |
dpyMultiary[key_, vals_] := | |
With[{c = Length @ vals}, | |
Module[{ | |
spans = Table["", {c}], |
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
formatJSON[json_] := formatRawJSON@rulesToAssociations[json] | |
rulesToAssociations[rules_] := | |
Replace[rules, r : {__Rule} :> Association[r], {0, Infinity}] | |
basicTypeQ[_String | True | False | Null | (_?NumericQ)] = True; | |
basicTypeQ[_] = False; | |
formatRawJSON[json_] := |