Craig Davis : There4 Development http://there4.posterous.com Most recent posts at Craig Davis : There4 Development posterous.com Wed, 02 May 2012 13:02:00 -0700 Google Chart Color List http://there4.posterous.com/google-chart-color-list http://there4.posterous.com/google-chart-color-list

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#3366CC
#DC3912
#FF9900
#109618
#990099
#3B3EAC
#0099C6
#DD4477
#66AA00
#B82E2E
#316395
#994499
#22AA99
#AAAA11
#6633CC
#E67300
#8B0707
#329262
#5574A6
#3B3EAC

This is the list of the first 20 colors from the Google Chart Color list. It's a great collection of unique saturated colors for use in charts and graphs.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1910539/craig.png http://posterous.com/users/hd2AYefn239sS Craig Davis there4 Craig Davis
Thu, 22 Mar 2012 11:09:00 -0700 QUnit rules for JSHint http://there4.posterous.com/114206140 http://there4.posterous.com/114206140

While updating the Uni-Form CSS project to use Grunt, I changed some of the settings for the linter, and for the first time, added lint rules for the unit test files. Grunt uses JSHint, and by default uses rules that are a bit more strict than I had used previously. In addition, the global variables from the QUnit tests were polluting the global namespace, and so I had to tell lint to ignore those.

Here's the final lint rules that I added to the test files, I hope they may be useful to someone else:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/** JSLINT CONFIG */
/*global window: false, document: false, $: false, log: false, bleep: false,
// QUnit vars
QUnit: false,
test: false,
asyncTest: false,
expect: false,
module: false,
ok: false,
equal: false,
notEqual: false,
deepEqual: false,
notDeepEqual: false,
strictEqual: false,
notStrictEqual: false,
raises: false,
start: false,
stop: false
*/

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1910539/craig.png http://posterous.com/users/hd2AYefn239sS Craig Davis there4 Craig Davis
Thu, 22 Mar 2012 08:20:00 -0700 Using Grunt with Travis CI http://there4.posterous.com/using-grunt-with-travis-ci http://there4.posterous.com/using-grunt-with-travis-ci

I've just finished adding the Grunt javascript build system to the Uni-Form CSS project. This finally gives us a nice build system to release minified javascript, and an easy way to run the unit tests and linters. This also gave me an easy way to get started with TravisCI. This runs the tests as a github hook, and allows us to show the world our current build status . 

However, in order to do so, I had to add a couple of extra snippets beyond the basic grunt implementation:

  1. Add a new .travis.yml file to the repo that can setup PhantomJS and set the project language to javascript.
    1
    2
    3
    4
    5
    6
    
    language: node_js
    node_js:
      - 0.6
    before_script:
      - "export DISPLAY=:99.0"
      - "sh -e /etc/init.d/xvfb start"
  2. Update the package.json with dependencies and scripts by making sure these sections are in the file:
    1
    2
    3
    4
    5
    6
    
    "dependencies": {
        "grunt": "~0.2.15"
      },
      "scripts": {
        "test": "grunt qunit"
      }

That's it - that's all it took to get a Grunt enabled repo to build with TravisCI.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/1910539/craig.png http://posterous.com/users/hd2AYefn239sS Craig Davis there4 Craig Davis