]> git.wincent.com - hextrapolate.git/log
7 years agoAdd icon for copy button
Greg Hurrell [Sun, 2 Aug 2015 02:47:38 +0000 (19:47 -0700)] 
Add icon for copy button

Got the SVG from: https://icomoon.io/app

Compressed it with svgo (`npm install -g svgo`; see

Converted to data URI with: https://gist.github.com/puppybits/1565441

Did consider skipping the base64-encoding step (ie.
https://css-tricks.com/probably-dont-base64-svg/) but decided against
it. It won't work in old browsers, and isn't much of a space saving

7 years agoAdd copy-to-clipboard functionality
Greg Hurrell [Sat, 1 Aug 2015 18:08:33 +0000 (11:08 -0700)] 
Add copy-to-clipboard functionality

Should work in recent Chrome, at least.

7 years agoAvoid unnecessary base conversions
Greg Hurrell [Sat, 1 Aug 2015 14:06:14 +0000 (07:06 -0700)] 
Avoid unnecessary base conversions

Instead of converting to a canonical hexadecimal base format, let the
updating component juts pass back the raw value + base. This should cut
the number of conversions by about 25%. For example, if I change the
binary field, instead of converting to hexadecimal once, then from
hexadecimal to some other base for three of the four fields (ie. four
total conversions), we instead just convert three fields.

7 years agoAdd some styling to make layout sane
Greg Hurrell [Sat, 1 Aug 2015 03:26:19 +0000 (20:26 -0700)] 
Add some styling to make layout sane

7 years agoAllow user to fully clear input field
Greg Hurrell [Sat, 1 Aug 2015 03:00:15 +0000 (20:00 -0700)] 
Allow user to fully clear input field

7 years agoHook up convert() function to UI to show that it works
Greg Hurrell [Sat, 1 Aug 2015 02:49:46 +0000 (19:49 -0700)] 
Hook up convert() function to UI to show that it works

7 years agoImplement `convert` function
Greg Hurrell [Sat, 1 Aug 2015 02:46:18 +0000 (19:46 -0700)] 
Implement `convert` function

Along with some illustrative tests. More to come (will fill in the blank
`it` blocks).

Based on the technique described at:


7 years agoDon't mutate input array in joinDigits()
Greg Hurrell [Sat, 1 Aug 2015 01:54:37 +0000 (18:54 -0700)] 
Don't mutate input array in joinDigits()

`reverse()` is a nasty API. It returns the reversed array, but also
mutates it in place. Noticed while using `joinDigits()` to log stuff
while developing.

7 years agoExtract joinDigits() function
Greg Hurrell [Sat, 1 Aug 2015 01:31:22 +0000 (18:31 -0700)] 
Extract joinDigits() function

7 years agoSpeed up multiplyDigits even more
Greg Hurrell [Sat, 1 Aug 2015 01:20:25 +0000 (18:20 -0700)] 
Speed up multiplyDigits even more

Implement the algorithm described in the last commit message.

7 years agoSpeed up multiplyDigits
Greg Hurrell [Sat, 1 Aug 2015 00:56:43 +0000 (17:56 -0700)] 
Speed up multiplyDigits

If we can double the length of the result in a single operation, we do.
This makes us faster for larger multipliers.

Note that I could make this even faster for really big multipliers by
employing some kind of memoization:

eg. multiply X by 1000:

  - iteration 0: X + X (2X)
  - iteration 1: 2X + 2X (4X)
  - iteration 2: 4x + 4X (8X)
  - iteration 3: 8X + 8X (16X)
  - iteration 4: 16x + 16X (32X)
  - iteration 5: 32X + 32X (64X)
  - iteration 6: 64X + 64X (128X)
  - iteration 7: 128X + 128X (256X)
  - iteration 8: 256X + 256X (512X)
  - iteration 9: 512X + 256X (768X) [use largest possible prev value)
  - iteration 10: 768X + 128X (896X) [largest possible is smaller now)
  - iteration 11: 896X + 64X (960X) [and smaller]
  - iteration 12: 960X + 32X (992X) [smaller]
  - iteration 13: 992X + 8X (1000X) [smaller still; note skip as well]

This might be hard to implement though. I was thinking it might call for
a heap but I don't think so; it just needs a stack, and we pop off until
we get a usable value from it.

7 years agoAdd multiplyDigits and friends
Greg Hurrell [Sat, 1 Aug 2015 00:43:08 +0000 (17:43 -0700)] 
Add multiplyDigits and friends

7 years agoMore setup, blinking light demo
Greg Hurrell [Fri, 31 Jul 2015 18:23:37 +0000 (11:23 -0700)] 
More setup, blinking light demo

This is a mess of things that should be committed separately, but rather
than do that I think I am just going to squash the history before
publishing. Or not. Possibly can't be bothered.

7 years agoUse the right port number
Greg Hurrell [Fri, 31 Jul 2015 17:25:54 +0000 (10:25 -0700)] 
Use the right port number

I find this makes all the difference...

7 years agoPull across sinon "mock" from docvim project
Greg Hurrell [Fri, 31 Jul 2015 17:22:12 +0000 (10:22 -0700)] 
Pull across sinon "mock" from docvim project

Should have down this previously, but overlooked it.

7 years agoForget about jsx extensions
Greg Hurrell [Fri, 31 Jul 2015 17:19:11 +0000 (10:19 -0700)] 
Forget about jsx extensions

I don't use (and never have used) them.

7 years agoIgnore built products
Greg Hurrell [Fri, 31 Jul 2015 17:16:19 +0000 (10:16 -0700)] 
Ignore built products

7 years agoReplace boilerplate server.js with gulp-based runner
Greg Hurrell [Fri, 31 Jul 2015 17:11:33 +0000 (10:11 -0700)] 
Replace boilerplate server.js with gulp-based runner

I want to use gulp as a uniform interface for building, running,
watching etc. This is a start.

7 years agoAdd `add` module
Greg Hurrell [Fri, 31 Jul 2015 14:34:55 +0000 (07:34 -0700)] 
Add `add` module

7 years agoTailor package.json metadata to match project
Greg Hurrell [Fri, 31 Jul 2015 13:39:59 +0000 (06:39 -0700)] 
Tailor package.json metadata to match project

7 years agoAdd standard test tools
Greg Hurrell [Fri, 31 Jul 2015 13:32:55 +0000 (06:32 -0700)] 
Add standard test tools

7 years agoBoostrap using react-hot-boilerplate
Greg Hurrell [Fri, 31 Jul 2015 06:12:53 +0000 (23:12 -0700)] 
Boostrap using react-hot-boilerplate

I am too lazy to figure out how to use Webpack etc, so just using this
minimal boilerplate as a starting point:


This corresponds to the current HEAD of the master branch (commit

7 years agoCreate new unparented branch for JavaScript implementation
Greg Hurrell [Fri, 31 Jul 2015 04:02:48 +0000 (21:02 -0700)] 
Create new unparented branch for JavaScript implementation

Getting this ancient codebase building on Yosemite is going to be more
trouble than it's worth (Xcode has changed too much, and GMP was always
hard to compile at the best of times), so let's rebuild this in
JavaScript as a web app.