Skip to content

Instantly share code, notes, and snippets.

View kristw's full-sized avatar

Krist Wongsuphasawat kristw

View GitHub Profile
#define TRUE FALSE
//Happy debugging suckers
@kristw
kristw / .block
Created June 9, 2016 05:09
Force-Directed Graph
license: gpl-3.0
@kristw
kristw / .block
Created June 9, 2016 05:12
Force-Directed Graph
license: gpl-3.0
@kristw
kristw / .block
Created June 9, 2016 08:16
Convex Hull
license: gpl-3.0
@kristw
kristw / .block
Created June 10, 2016 00:23
Convex Hull
license: gpl-3.0
@kristw
kristw / .block
Created June 10, 2016 00:50
Collision Detection
license: gpl-3.0
prompting: function () {
// Have Yeoman greet the user.
// Would love to skip this if this generator is called from another generator.
this.log(yosay(
'Welcome to the <%- superb %> ' + chalk.red('<%= generatorName %>') + ' generator!'
));
var prompts = [{
type: 'confirm',
name: 'someAnswer',
// generator from another package
this.composeWith('backbone:route', {
options: options
}, {
local: require.resolve('generator-bootstrap')
});
// local subgenerator
this.composeWith('mygenerator:git', {
options: options
this.fs.copyTpl(
this.templatePath('index.html'),
this.destinationPath('public/index.html'),
{ title: 'Templating with Yeoman' }
);
@kristw
kristw / index.js
Last active August 1, 2016 16:47
An example generator with yeoman-easily
var ye = require('yeoman-easily');
var Easily = ye.Easily;
var commonPrompts = ye.prompts;
var chalk = require('chalk');
module.exports = Easily.createGenerator({
prompting: function () {
return this.easily
.greet('Welcome to the awesome generator!')
.confirmBeforeStart('Would you like to use bower?')