Skip to content

Instantly share code, notes, and snippets.

Edward Bramanti jadengore

Block or report user

Report or block jadengore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jadengore
jadengore / cloudSettings
Last active Jan 6, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-01-06T00:03:34.683Z","extensionVersion":"v3.2.4"}
View get-latest-node-version.sh
nvm ls-remote | tail -1 | sed -r 's/.*v(\S+).*/\1/'
View delete_all_branches_except.fish
git branch -D (git branch | grep -E -v 'develop|master' | tr -ds '\n' ' ' | sed 's/^[ \t]*//')
View bookshelf-transaction-coroutine.js
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' }
],
View apps.md
  • Bartender 2
  • Brave
  • Caret
  • Gitify
  • Gitter
  • Hacker Menu
  • Lighting
  • Paw
  • Screenhero
  • Spotify Bluetooth Headset Listener
View promise-series-migration-example.js
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'))
]);
};
View promise-series-broken-implementation.js
const Promise = require('bluebird');
Promise.series = (promiseArr) => Promise.each(promiseArr, (result) => result);
View knex-migration-promise-example.js
const Promise = require('bluebird');
exports.up = function(knex) {
return Promise.all([
knex.schema.renameTable('tomatoes', 'potatoes'),
knex.schema.table('potatoes', (table) => table.string('name'))
]);
};
View request-file-coroutine.js
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.';
})();
View coroutine-test-example.js
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 =
You can’t perform that action at this time.