###Pros:
- npm as CDN; no more GitHub API and rate limiting
- npm provides search & indexing
- package.json provides metadata
- handles multiple version numbers
- npm is download client; simpler tsd CLI
###Cons:
###Pros:
###Cons:
// Build configuration for libfoo | |
{ | |
// ...... | |
wrap: { | |
start: | |
` | |
;(function(global, outerDefine) { | |
var require, define; | |
`, | |
end: |
// Initialize URL parameters | |
var params = { | |
type: 'date', | |
levels: 3, // 2 == yes-no poll, 3 = yes-no-ifneedbe poll | |
locale: 'en', | |
title: 'Ultimate Pickup @ The Bubble', | |
location: 'Harvard Bubble', | |
description: '', | |
name: 'Magazine Beach Pickup', | |
eMailAddress: '[email protected]' // Poll admin link is emailed to this address |
Cool beans! I'm coming at this from a Windows perspective, but this should work well in Linux or Mac as well.
Install NodeJS. On Windows, you go to the website, run the installer, and click "Next" a few times. http://nodejs.org/
Install stylus using NodeJS's package manager, npm, which has been automatically installed for you. Open a terminal and run:
npm install -g stylus
Create your Stylus code and save it as something like my-styles.styl. You can probably rename your existing .css file to .styl without changing anything else.
// Given an array of numbers, returns either the index containing that number | |
// or `undefined` if the array doesn't contain that number. | |
// Assumes that `list` is a non-sparse JavaScript array, that all items in the list are integers, | |
// and that the list is sorted in ascending order (obviously) | |
// Assumes that `value` is an integer. | |
function binarySearch(list, value) { | |
// Lower bound = minimum possible index | |
var lowerBound = 0; |
// event handlers as methods | |
object object0 { | |
create() { | |
event_bind(ev_step, _ev_step); | |
} | |
script _ev_step() { | |
// do stuff |
// all-sprites.js | |
define([ | |
require('text!sprite1.json'), | |
require('text!sprite2.json'), | |
require('text!sprite3.json'), | |
require('text!sprite4.json') | |
]); |
SuperClass = function() {} | |
SubClass = function() {} | |
SubClass.prototype = Object.create(SuperClass.prototype); | |
// Or, if the JS engine doesn't have Object.create... | |
var ctor = function() {} | |
ctor.prototype = SuperClass.prototype; |
/* New format for GG2 leveldata. | |
* This JSON document fully describes a GG2 level. | |
* It can be embedded into a PNG with GG2DLL, | |
* packed up in a zip along with any BG/WM images, | |
* sent over the network, etc. | |
* | |
* Also this should be ready for future improvements and changes, unlike the terrible older format. | |
*/ | |