I found Mocha and Chai on cdnjs and created a small example of running them inside jsbin.
jschain: meanjs (#11)
I like building up a project from small parts but sometimes it’s good to try using a full framework to see what parts I’m missing. Today I tried starting a mean.js app with yeoman. It comes with a lot preconfigured, including five different authentication options, and since I chose it, an articles model. I removed four of the five authentication modules and changed the name of Article to Bin. In the process I found where things are stored in mean.js. It seems to do a good job of following the rails mantra of Convention Over Configuration.
- The Code (unfinished, and most of it isn’t mine, the commits show what I did)
I want to return to this experiment and get it working the rest of the way and deployed on Heroku. The basic idea is a minimalistic jsfiddle.
jschain: map with d3 (#10)
I used d3 to make a map. It was good practice. I had forgotten how d3?s chaining API works. When a function mutates an element, it returns the same element back. When a function appends something to an element, it returns the new element back.
I also tried using patterns in svg. I still have to learn some more to understand them and to get the results I want, and I also need to brush up on biezer curves.
Update: I adjusted the vertical offset of the pattern to remove gaps between states.
jschain: fabric, doge (#9)
Today I checked out Fabric.js. The basics are surprisingly quick to learn!
jschain: grunt, unindented (#8)
In Grunt the examples and virtually all code are wrapped up in one big function. Gulp doesn’t require this, and I’m under the impression many prefer this. However Grunt has a huge standard library.
I like code that doesn’t leave the left margin for long because it’s easier for me to see chunks of code. It also allows me to interleave code, which sometimes makes a lot of sense.
Using OOP, Grunt can be made to have this style. I took the Gruntfile for jquery and made it stay to the left margin while working the same way.
I won’t be sending a pull request, but I may do this on one of my own projects.
jschain: component, react, and koa (#7)
I’ve started playing with Component again after finding some neat devs/projects/companies that use it. I also checked out ES6 generators in the development version of node and Koa which uses generators. Pretty neat stuff!
I created an example app that uses both Koa and Component but doesn’t do anything server-side. A possible future project is to make my example app use a server-side JSON API to do something.
jschain: react and setting CSS (#6)
Update: I got it to animate all of the divs. My mistake was that I had the divs changing their position in the DOM, in addition to changing the CSS properties. Some of the divs didn’t change position in the DOM because their index was the same both alphabetically and by population, and these were animated.
I played with React some more, this time loading it from a CDN with the jsx compiler. I set the CSS properties on the divs and tried animating them using CSS3 transitions. Some are animated while some move to their new position instantaneously.
jschain: React and browserify (#5)
I made a little sign-up form example with React.
I built it in RequireBin. The main react model in isn’t working in RequireBin and I’m working to get it fixed. In the meantime I’ve published benatkin-react to npm which makes the minimal changes needed to get it to work (none to the code, just to the packaging).
The sign-up form I made has validation which highlights invalid fields with red after an attempt has been made to enter it in correctly.
jschain: requirebin and vue (#4)
jschain: todo with tags, using react (#3)
I wrote a little todo list with tags, based on the TODO example on the React home page, in React. It’s on jsfiddle.
jschain: ng-template-markdown (#2)
This is a partial implementation of Markdown to show how it might be rendered in angular without asking its template engine to insert HTML.
jschain: parafocus (#1)
I used these resources to help me get it done:
- How to listen for key presses with AngularJS – showed me that I wanted was keydown events on the body tag using ng-keydown
- 5apps – a lot like GitHub pages with Jekyll turned off, except I don’t need to create another branch. Unlike Heroku, free apps don’t go to sleep.