Rounding to significant figures in Postgres

If you want to round numbers to a specified number of significant figures, you can do this with the logarithm functions. For example, rounding the following numbers to two digits would do the following: 10;10 15;15 105;100 109;100 997;990 105050;100000 123456;120000 193456;190000 Here is the SQL – note the “-1” needs to be off by […]

React Hot Loader: First Thoughts

The React Hot Loader is a tool to reload Javascript on a page as you edit React components (see video for a demo). So far, this works really well for me – I haven’t attempted anything large yet, but this improves development so much that it is clearly going to be the golden path for […]

Fixing “The following modules couldn’t be hot updated”, “Full reload needed”

I wrote a small React application to test hot loading components using webpack-hotmiddleware, and received the following error: [HMR] The following modules couldn’t be hot updated: (Full reload needed) This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See for more details. process-update.js:69 […]

Fixing “Update check failed” with the React hot loader

When I tried to set up webpack with the React hot loading utilities, I got it running, but was receiving this error every time a component updated: “Update check failed” react hotloader The fix for this seems to be upgrading to a newer set of utilities (these are being renamed/repackaged differently) from Make sure […]

How to escape code blocks in Jekyll

If you paste code into highlightjs blocks in Jekyll templates, you can get errors like this: Error: Liquid syntax error: Variable ‘{{{ * val mybreaks = new Breaks * import mybreaks.{break, breakable}’ was not properly terminated with regexp: /\}\}/ Error: Run jekyll build –trace for more information. Regenerating: 1 file(s) changed at 2016-02-21 16:29:07 Liquid […]

Fixing error “bash: browserify: command not found”

If you follow the steps on the browserify site, you may find that it does not work afterwards: npm install -g browserify When I tried to run browserify, I got this error: bash: browserify: command not found In the log output, you will see something like this, which indicates that NPM makes a symlink in […]

HTTPS request with python

Run this to get all the HTTP libraries involved: sudo easy_install request urllib3 pyopenssl ndg-httpsclient pyasn1 Then you can do HTTPs requests: url = \ "" + "scala/6d09a1ba5fffadd1d886afb66ab4496291fda3dd/" + "src/library/scala/util/control/Breaks.scala"   import requests code = requests.get(url).content

Convert scaladoc output to Markdown and Jekyll

Scaladoc generates a listing page for every class you run it on. In this post, I’ll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add / modify formatting as desired). I got the main scala library, […]