goatslacker

  • Archive
  • RSS
  • Ask me anything

Introducing gister

A nodejs module for programmatic access to create, edit and retrieve gists from github.

There are quite a few gist libraries available from npm. Most were CLI apps to create new gists, others didn’t exactly meet my needs. So I set out to create gister which provides what I think is a simple API. It follows the observer pattern and uses request to talk to GitHub.

Read the annotated source or check out the code.

Using it is really simple. Here’s how you retrieve a gist with gist_id = 1:

var gist = new Gist({ gist_id: 1 });
gist.on('get', function (data) {
  // do something with data
});
gist.get();

Creating a new gist is similar, although you’ll need to provide Gist with your GitHub username and Secret API Token which can be found in your Account Settings

var gist = new Gist({ username: 'goatslacker', token: 'abc123' });
gist.on('created', function (data, gist_id) {
  // gist_id is the newly created gist id
  // data is what github returns in it's reply
});
gist.create();

Available on npm. Install:

npm install gister
    • #cli
    • #gist
    • #github
    • #javascript
    • #node.js
    • #npm
  • 5 months ago
  • 14
  • Comments
  • Permalink
  • Share
    Tweet

Adding node.js project that uses git-submodules to travis-ci

Recently, I added my projects node-fixmyjs jshint-autofix to Travis-CI which is excellent. Travis is a build system for the open source community, I recommend you take a look at it if you haven’t.

Anyways, both of my projects depended on submodules and the tests were initially failing because I didn’t know how to tell Travis to download the submodules before running the unit tests.

So here’s what you’re supposed to put in your .travis.yml file:

language: node_js
node_js:
  - 0.6
before_install:
  git submodule init && git submodule --quiet update
    • #code
    • #continuous
    • #integration
    • #javascript
    • #node.js
    • #quality
    • #ruby
    • #travis-ci
  • 5 months ago
  • 16
  • Comments
  • Permalink
  • Share
    Tweet

Excellent JavaScript resources for all

A compilation of great JavaScript articles found on excellent blogs. Must read if you’re into JS

    • #JavaScript
  • 5 months ago
  • Comments
  • Permalink
  • Share
    Tweet
← Newer • Older →
Page 2 of 5

About

Software Engineering, Music, Sports
  • @goatslacker on Twitter
  • Facebook Profile
  • goatslacker on Last.fm
  • goatslacker on Grooveshark
  • Linkedin Profile
  • goatslacker on github

Twitter

loading tweets…

Posts I like

See more →
  • Video via izs
    Video

    Watch this video. I really like a lot of what he has to say. Two main comments:

    1. 165 Exceptions in the standard library, is enough!? Are you...
    Video via izs
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Josh Perez. Effector Theme by Carlo Franco.

Powered by Tumblr