Skip to content

Instantly share code, notes, and snippets.

@ebramanti
ebramanti / cloudSettings
Last active January 19, 2021 17:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-01-19T17:55:51.022Z","extensionVersion":"v3.4.3"}
nvm ls-remote | tail -1 | sed -r 's/.*v(\S+).*/\1/'
git branch -D (git branch | grep -E -v 'develop|master' | tr -ds '\n' ' ' | sed 's/^[ \t]*//')
var Promise = require('bluebird');
Bookshelf.transaction(Promise.coroutine(function*(t) {
const library = yield Library.forge({name: 'Old Books'}).save(null, {transacting: t});
return yield Promise.map(
[
{ title: 'Canterbury Tales' },
{ title: 'Moby Dick' },
{ title: 'Hamlet' }
],
  • Bartender 2
  • Brave
  • Caret
  • Gitify
  • Gitter
  • Hacker Menu
  • Lighting
  • Paw
  • Screenhero
  • Spotify Bluetooth Headset Listener
const Promise = require('bluebird');
Promise.series = (promiseArr) => Promise.each(promiseArr, (result) => result);
exports.up = function(knex) {
return Promise.series([
knex.schema.renameTable('tomatoes', 'potatoes'),
knex.schema.table('potatoes', (table) => table.string('name'))
]);
};
const Promise = require('bluebird');
Promise.series = (promiseArr) => Promise.each(promiseArr, (result) => result);
const Promise = require('bluebird');
exports.up = function(knex) {
return Promise.all([
knex.schema.renameTable('tomatoes', 'potatoes'),
knex.schema.table('potatoes', (table) => table.string('name'))
]);
};
const requestFromLinkInFile = Promise.coroutine(function*() {
const url = yield fs.readFile('link.txt');
const response = yield request.get(url);
return response.body ? response.body : 'No body returned from request.';
})();
describe('GET potatoes', function() {
it('returns JSON with only authenticated robot\'s potatoes', function*() {
const glados = yield factory.create('robot');
const gladosPotatoes = [
yield factory.create('potato', { ownerId: glados.id });
yield factory.create('potato', { ownerId: glados.id });
];
const wheatley = yield factory.create('robot');
const wheatleyPotato =