invoke and execute in Rake

When writing tests for a Rake task at work, I came across invoke and execute as two different ways for calling a specific task. Most of the content I found online about the difference was fairly superficial: invoke can only get called once, execute can be called as many times as one wants. There, are you happy? Move on. Never being generally happy, I did not move on. I wanted to know how these similar-looking methods were executed differently. So, I consulted The Truth. ...

Nov 23, 2016 · Christopher Boette

Dada Photo Booth

An Inscrutable Representation of Yourself tumblr | source code, v1 | source code, Electron client and server developer, artistic collaborator Designed and developed as a final project for dadageek’s course on creating generative art using Processing. Presented at the Fall 2016 Dadageek Student Showcase, which was part of EAST. Tech Stack Go and Go OpenCV binding for image capture and cropping Processing for image manipulation [i.e. making the art] Gifsicle for generating and compressing gifs Ruby for posting to Tumblr and local file cleanup Reincarnated as an experience using p5.js for 2018 EAST. Read more about it on the blog.

Nov 14, 2016 · Christopher Boette

assert_equal in MiniTest

https://gist.github.com/chrisbodhi/b7b10f5e428088fa38da @chrisbodhi I also find it difficult to understand how the test cases are passed. I’ve checked them and they do, but in my opinion test_name_sticks should fail as every call to name will append a new random name to the previous one instead of returning the same string. For example, if we run a simple test: robot = Robot.new 2.times{puts robot.name} we get: QF658 QF658YV199 making it clear that the test should fail. —franrodalg ...

Feb 15, 2015 · Christopher Boette

Refactoring. It's a delight.

From https://gist.github.com/chrisbodhi/15210705414f1b4afcf2 to file_info[:control_info].map {|arr| arr[1] } to file_info[:control_info].map(&:last)

Feb 1, 2015 · Christopher Boette

(&:stuff) > {|a| a.stuff}

Rather than writing object.map{ |o| o.action }, I just found out that I could write object.map(&:action). I’m currently attempting to suppress a very strong urge to refactor everything in my current project. No curly braces, no pipes? Sign me up! src & in the Ruby docs

Jan 29, 2015 · Christopher Boette

Markov Q. Aurelius

Philosopher for the 21st Century on twitter | was once on heroku | source code developer, designer Uses Marcus Aurelius’s “Meditations” and a Markov Chain to generate philosophical quotes that are posted to Twitter daily. Tech Stack Ruby on a GitHub Action Twitter & marky_markov Ruby gems Daily post through another GitHub Action

Apr 20, 2014 · Christopher Boette

Mars Attracts!

Book a Flight to Mars! (Not Really) project | source code developer, designer A speculative fiction flight reservation app set in the near future, facilitating relocation to a newly colonized Mars. Built over 2+ weeks as part of a team of three. Tech Stack Angular.js frontend Ruby on Rails backend ForecastIO & MAAS Mars Weather APIs Foundation & Simple_Form Ruby gems Haml & Sass templating PostgreSQL database Deployed to Heroku

Jan 31, 2014 · Christopher Boette

Expect These to Get Shorter...

Day 6 at MakerSquare. Week 2. This time, I’m in a new building, which is really the old building. The atmosphere is different, but that might just be the absence of glass walls and paint fumes. Upsides: standing desk and a coffee maker.Downsides: one bathroom for 20+ dudes and too much coffee. Back-end now happens in the morning, which is the opposite of last week. I’m not sure if it’s better or worse [but it’s probably neither - “Man is disturbed not by things, but by the views he takes of them”]. Dug deep into Ruby classes with my new pair. Seeing as I’m writing this after catching up on the morning’s work [at 2245], maybe we dug too deep. If we hadn’t though, I wouldn’t have learned that the ‘puts’ method looks for a custom 'to_s’ method in classes, and print that output as opposed to the unreadable-by-human object! My notes from that moment read as, “implicit class methods to make objects readable?! mind blown!” ...

Nov 19, 2013 · Christopher Boette

Better Than Stir Friday

Day 5 at MakerSquare. Friday is Tie Day. & also project day. Front-end: Pick a website and redesign it. I had originally picked the site for my favorite diner in town, Kerbey Lane. Excellent pancakes, cluttered website. It was correctly suggested that the scope of that redesign would be too much. I then picked another local institution, Austin Books & Comics. I started by sketching out some mockups and jumped in. No good. No good at all. ...

Nov 16, 2013 · Christopher Boette

Quote for 2013-11-14

The gist pointed out that Hash.new, with its default values, is good for implementing Fibonacci sequences. So I decided to check: fib = Hash.new do |hash,key| k = key.to_i hash[key] = case k when 0 then 0 when 1 then 1 else hash[k-1] + hash[k-2] end end This recursive (and memoized!) definition means that you can do fib[18] and get back 2584, plus you get the Fibonacci numbers from F0 (fib[0]) to F17 (fib[17]). Recursively defined Hashes are useful auto-memoized structures. ...

Nov 14, 2013 · Christopher Boette