Skip to content

Instantly share code, notes, and snippets.

View holmesal's full-sized avatar
:bowtie:
makin'

Alonso Holmes holmesal

:bowtie:
makin'
View GitHub Profile

With sourcemaps: 1m7.692s

time react-native bundle --entry-file index.ios.js --bundle-output=ios/main.jsbundle --sourcemap-output=ios/main.jsbundle.map --reset-cache

time react-native bundle --entry-file index.ios.js --bundle-output=ios/main.jsbundle --sourcemap-output=ios/main.jsbundle.map --reset-cache
(node:45341) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
[12/9/2016, 5:27:15 PM] <START> Initializing Packager
[12/9/2016, 5:27:15 PM] <START> Building in-memory fs for JavaScript
[12/9/2016, 5:27:15 PM] <END>   Building in-memory fs for JavaScript (181ms)
export const requireAuth = (target, name, descriptor) => {
const resolver = target[name].resolve;
target[name].resolve = (user, args, context) => {
const { user: authUser } = context;
// If there exists an authUser, then allow the read
if (authUser) {
return resolver(user, args, context);
} else {
// this field will resolve to null for unauthenticated users
return null;
var UserType = new GraphQLObjectType({
name: 'User',
description: 'A venerable Chorus user',
isTypeOf: (obj, info) => obj instanceof db.User,
interfaces: [nodeDefinitions.nodeInterface],
fields: () => ({
id: globalIdField('User'),
// no decorator here - this is public
username: {
type: GraphQLString,
var UserType = new GraphQLObjectType({
name: 'User',
description: 'A venerable Chorus user',
isTypeOf: (obj, info) => obj instanceof db.User,
interfaces: [nodeDefinitions.nodeInterface],
fields: () => ({
id: globalIdField('User'),
username: {
type: GraphQLString,
description: 'A username.',
var QueryType = new GraphQLObjectType({
name: 'Query',
description: 'A type used to make queries',
fields: () => ({
node: nodeDefinitions.nodeField,
viewer: {
type: types.UserType,
description: 'The currently authenticated user',
resolve: (parent, _, {user}) => user
},
2pm - new york
2:30pm - dc
4pm - chicago
5pm - san francisco
6pm - los angeles

Sync logs from s3 bucket

aws s3 sync s3://league-loadbalancer-logs2/league-production/AWSLogs/478410257198/elasticloadbalancing/us-east-1/2016/09/01 ./

Count requests by status code

awk '{if($13=="https://love.theleague.com:443/api/v1/person/me/potentials") print($8 " " $13)}' access.log | sort | uniq -c | sort -r

import { GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLList } from 'graphql';
import { globalIdField } from 'graphql-relay';
import CityDayType from '../../CityDay/types/CityDay';
import AccommodationPlacementType from '../../Supplier/types/AccommodationPlacement';
export default new GraphQLObjectType({
name: 'CityBooking',
description: 'The city booking object in Quickplan',
fields: () => ({
id: globalIdField('CityBooking', city => city._key),
How can we take some load off the DB when querying for realtime hearts?
Bottom line, it has to be fast as shit. So that means we should probably store it in redis.
What about:
Every time someone hearts someone else, add it to that user's list and set an expire time of the next happy hour.
Important question - should the potentials be created when the user hearts the other user, or when the other user requests their batch?
The second one.
@holmesal
holmesal / 1overx.js
Created May 11, 2016 20:21
1/x with react-native Animated
import React, {
Animated,
Component,
View
} from 'react-native';
export default class EasingTest extends Component {
state = {
input: new Animated.Value(0)