SE Block Gets an Update

This week, I released an update to SE Block, the Chrome extension that removes some of the cruft from the otherwise-excellent Stack Exchange pages. I had initially struck upon the idea for the extension shortly after I started my last job. Spending a lot of time on Stack Overflow, I found myself getting distracted by whatever was trending on the rest of the network—analysis of characters in Gibson’s Bridge Trilogy? efforts to build supercapacitors using graphene sheets? mining the bowels of the English language to satisfy an itch for the perfect word choice? #relevant to this blog’s interests #productivity drain ...

Jun 28, 2015 · Christopher Boette

Using Stormpath as an SSO Provider for Discourse

Stormpath: User Auth & Management as a Service [UAMaaS?] Discourse: an open source forum, designed for reading SSO: single sign-on; “… a user logs in once and gains access to all systems without being prompted to log in again at each of them.” [src] As we’re moving toward an open beta for the company’s new product, web work to promote, support, and disseminate information is ramping up. I was tasked with using Stormpath as the SSO provider for our Discourse forums. If I made a mistake with this configuration, I would be locked out of any settings panel on the Discourse side. The only way to regain access would be ssh-ing into the Discourse box and executing some commands from irb. The catch was that no one knew the address for that hosted box. The solution? ...

Apr 25, 2015 · Christopher Boette

Getting Going with React, Part II: On to Development

part one here | completed portfolio site redesign here Rather than jumping into a full web application, I decided to start small with something I could finish in one sitting. I already had designed my portfolio site to use card-like visual components for each project. Having read over this article on thinking in React, I figured a rebuild would be a natural fit. Step one was to dump all of the content into a JSON file, which I could use instead of an actual database. This approach made sense because of the small amount of content, the lack of updates to the site [working on this!], and my lack of interest in setting up & maintaining a database through my shared web hosting service. ...

Mar 1, 2015 · Christopher Boette

Getting Going with React

Part I: Before I Typed a Single Curly Brace or Semicolon When I first saw some JSX code in a tutorial on React, I immediately poo-pooed the whole library: “What is that, HTML in JavaScript? Facebook, grrr! I’m no wizard, but that’s a terrible combination of concerns! Also, it’s ugly and please give me back my Jade, immediately.” But, as time went on and as one of my co-workers continued his incessant gushing about React, I finally broke down and gave it a spin. And I really, really liked it. ...

Feb 21, 2015 · Christopher Boette

bash command magic

Since I can’t upvote the question or answer, I thought I’d just give a shout-out to this question on unix.stackexchange.com. To delete duplicate rows from a CSV file using the command line: awk -F, '!seen[$0]++' inputfile.csv > outputfile.csv Fantastic.

Feb 18, 2015 · 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

XML Shenanigans

For the last couple of weeks, I’ve been working on a project at work that has involved, among other things, parsing XML and updating existing XML files. Just like every other time I have to deal with XML, I do two things: Throw up a little bit. gem install nokogiri I found lots of code samples, including in the Nokogiri tutorials, that discussed how to create a new node and then insert a string as the node contents. This would have been ok if my node contents didn’t contain more nodes. Nokogiri tried to be helpful and escaped the node contents. So, not very many < and >, but lots of &gt; and &lt;. ...

Feb 9, 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

Add GitHub gists to your Tumblr posts

https://gist.github.com/1395926

Jan 31, 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