Skip to content

Instantly share code, notes, and snippets.

Adam Gall adamgall

View GitHub Profile
@adamgall
adamgall / express-response-flow.js
Created Jun 10, 2019
i don't understand promises
View express-response-flow.js
export const register = (req, res) => {
const newUser = new User(res.locals.db)({
name: req.body.name,
email: req.body.email,
password: req.body.password
});
User(res.locals.db)
.findOne({ email: newUser.email })
.then(checkDuplicateUser(res))
View gist:e8ff84eed682e5d59aea6a7f416adda1
Verifying my Blockstack ID is secured with the address 14x3j7Cvye7usFNUwPhHVRp7dHKDevtvTo https://explorer.blockstack.org/address/14x3j7Cvye7usFNUwPhHVRp7dHKDevtvTo
View airdrop.js
const BigNumber = require('bignumber.js');
const fs = require('fs');
const fastCsv = require('fast-csv');
const web3utils = require('web3-utils');
function drop(instance, filePath) {
return prepareTransfers(filePath)
.then(transfers => checkBalances(instance, transfers))
.then(transfers => filterAccounts(transfers))
.then(transfers => makeTransactions(instance, transfers))
View genesis_public_key
049af98c5d8f183ae990a34c550d0ee71597203ae4a274e6d7f1744d49886fa3ee3d3f6c2fd9aceb7a56e354f2ab1aaf7d374c9823825cd1b656abee72160662b6;BrandonShega
View keybase.md

Keybase proof

I hereby claim:

  • I am adamgall on github.
  • I am adamgall (https://keybase.io/adamgall) on keybase.
  • I have a public key ASDwJkkcuP6BJtsOeT5x2hRR0fNvCzapfMiqMgYrHIc7YQo

To claim this, I am signing this object:

View pipeDreams
(
{
morningEvent = YES;
eveningEvent = YES;
startDay = "2014-05-27 04:00:00 +0000";
},
{
morningEvent = NO;
eveningEvent = YES;
startDay = "2014-05-28 04:00:00 +0000";
View entityObject
{
startDay: 2014-05-17 00:00:00.000,
startDateTime: 2014-05-17 08:30:00.000
},
{
startDay: 2014-05-17 00:00:00.000,
startDateTime: 2014-05-17 17:00:00.000
},
{
startDay: 2014-05-18 00:00:00.000,
View results
(
{
maxEventStartTime = "2014-04-30 17:00:00 +0000";
minEventStartTime = "2014-04-30 17:00:00 +0000";
startDay = "2014-04-30 04:00:00 +0000";
},
{
maxEventStartTime = "2014-05-01 14:00:00 +0000";
minEventStartTime = "2014-05-01 04:00:00 +0000";
startDay = "2014-05-01 04:00:00 +0000";
View fetchEventDays.m
- (void)fetchEventDays
{
NSExpression *startDateTimeExpression = [NSExpression expressionForKeyPath:@"startDateTime"];
NSExpression *minStartDateTime = [NSExpression expressionForFunction:@"min:" arguments:[NSArray arrayWithObject:startDateTimeExpression]];
NSExpression *maxStartDateTime = [NSExpression expressionForFunction:@"max:" arguments:[NSArray arrayWithObject:startDateTimeExpression]];
NSExpressionDescription *minStartDateTimeExpression = [[NSExpressionDescription alloc] init];
minStartDateTimeExpression.name = @"minEventStartTime";
minStartDateTimeExpression.expression = minStartDateTime;
minStartDateTimeExpression.expressionResultType = NSDateAttributeType;
View NIAgendaDetailViewController.m
@interface NIAgendaDetailViewController ()
@property (nonatomic, weak) IBOutlet UITableView *table;
@property (nonatomic, strong) NIAgendaDetailMainCell *mainCellTemplate;
@end
@implementation NIAgendaDetailViewController
- (void)viewDidLoad
You can’t perform that action at this time.