I hereby claim:
- I am bvandgrift on github.
- I am bvandgrift (https://keybase.io/bvandgrift) on keybase.
- I have a public key ASAf4orFDrtbzOXVMO64S8C44-wKfuSIdKy5-VCmHth31wo
To claim this, I am signing this object:
| // more javascripty! | |
| const FRIENDLY = { | |
| MAYBE: 'pet at your own risk', | |
| YES: 'ok to pet', | |
| NO: 'do NOT pet' | |
| } | |
| class Pet { | |
| constructor(name, isFriendly = FRIENDLY.MAYBE, sound = "UNKNOWN") { |
| #!/usr/bin/env bash | |
| # given a single case id (e.g., 19820427023459I) will check to see if | |
| # it exists in the output directory, otherwise fetch it -- | |
| # it won't store the file if there's a problem with the request | |
| # usage: ./fix-missing.sh <case_id> | |
| if [ `ls out/${1}.html 2> /dev/null` ]; then | |
| exit | |
| else |
| test "don't do unnecessary work for no change" do | |
| # let's assume that there's an enqueue(evt) method which pulls an event into the | |
| # processing pipeline, and that the enqueue method in turn calls a process(evt) method | |
| # let's further assume that if an event has an attribute, once processed, we don't want | |
| # to process it again for the same attribute value. so evt(attr:5), evt(attr:5), evt(attr:6) would | |
| # generate two process() calls, not three. | |
| pipeline = Pipeline.new() # or whatever |
I hereby claim:
To claim this, I am signing this object:
| ## off the top of my head, syntax problems are an exercise for the reader | |
| list = [:a, 'list', 3, 1.15, {b: 'yes, really'}] | |
| # a simple list comprehension. | |
| list.each do |thing| | |
| puts thing.class # or some triviality | |
| end | |
| # functions take blocks, by default -- a block is a closure over |
| // why not let set and spread do all the work? | |
| // arbitrary number of arrays, unique | |
| function unicat(...arrays) { | |
| let collector = []; | |
| arrays.forEach((a) => {collector = collector.concat(a);}); | |
| return Array.from(new Set(collector).values()); | |
| } | |
| // O(n), i think, if concat() is implemented sanely. |
| // takes a fn and a number of arguments to append to the | |
| // fn's argument list | |
| var rPartial = function(fn, extras) { | |
| var postArgs = [].slice.call(arguments).slice(1); | |
| return function(vars) { | |
| var preArgs = [].slice.call(arguments); | |
| var allArgs = preArgs.concat(postArgs); | |
| return fn.call(fn.this, ...allArgs); | |
| }; |
| module AttributeRequirements | |
| extend ActiveSupport::Concern | |
| SQL_TYPE_MATCHERS = { | |
| /^character varying/ => String, | |
| /^text/ => String, | |
| /^enum/ => String, | |
| /^timestamp/ => DateTime, | |
| /^integer/ => Integer, |
| Verifying that +bvandgrift is my blockchain ID. https://onename.com/bvandgrift |
| ;; response to: https://forums.pragprog.com/forums/352/topics/13835 | |
| ;; this is a quick demonstration of the pitfalls in querying for a ref | |
| ;; outside of the accompanying transaction in which you plan on changing it. | |
| (import '(java.util.concurrent Executors)) | |
| ;; start list | |
| (def slist (ref #{})) |