Skip to content

Instantly share code, notes, and snippets.

View colwem's full-sized avatar

Martin Colwell colwem

View GitHub Profile
class Game
def initialize
@board = Board.new 100,100
add_objects
end
def add_objects
#add objects to board
@colwem
colwem / test.log
Created February 25, 2016 23:51
output of running tests
vagrant@habitrpg:/vagrant$ gulp test
[23:37:32] Using gulpfile /vagrant/gulpfile.js
[23:37:34] Starting 'test:all'...
[23:37:34] Starting 'lint:server'...
[23:37:36] Starting 'lint:common'...
[23:37:36] Starting 'lint:tests'...
[23:37:37] Finished 'lint:server' after 3.22 s
[23:37:58] Finished 'lint:common' after 22 s
[23:37:59] Finished 'lint:tests' after 23 s
[23:37:59] Starting 'lint'...
'use strict';
const expect = require('chai').expect;
describe('foo', () => {
it('should finish', (done) => {
Promise
.reject(new Error())
.catch(() => expect(false).to.be.true)
.then(() => done(), done);
.jumbotron
.container
.visible-xs-block
.center-block
img(
alt="AutoCron"
src="/images/logos/AutoCronLogo.svg")
.title.h1
| AutoCron
.subtitle.h1
'use strict';
riot.tag2('cron-time', ' <select onchange="{_update}">\n <option each="{hours}" value="{hour}" __selected="{selected}">{hour}</option>\n </select>\n', '', '', function(opts) {
const self = this;
function range(start, end) {
return Array.apply(Array, Array(1 + end - start)).map((_, i) => {
return i + start;
});
}
this.hours = range(opts.dayStart + 1, 24).map((hour) => {
@colwem
colwem / .js
Last active March 21, 2016 02:58
User.find({UTCCronTime: hour})
.each((user) => {
api.getUser(user);
})
.catch((err) => {
console.log(err);
});
function getConnection(connectionString) {
return Promise.try(() => {
return mongoose.connect(uri);
})
.disposer(() => {
mongoose.disconnect();
})
}
Promise.using(getConnection(uri), (connection) => {
function! MoveToMiddle()
let end = strdisplaywidth(substitute(getline('.'), '\s*$', '', ''))
let start = indent('.')
call cursor(0, (start + end)/2)
endfunction
map gm :call MoveToMiddle()<cr>
funcWithCallback(args, createCallback(obj));
function createCallback(obj) {
return function (err, data) {
//do stuff with data and obj
}
}
import {
createAndPopulateGroup,
generateUser,
} from '../../../helpers/api-integration/v2';
import { each } from 'lodash';
describe('POST /groups/:id/invite', () => {
context('user is a member of the group', () => {
each({
'public guild': {type: 'guild', privacy: 'public'},