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
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,
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;

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)
@holmesal
holmesal / pull-request-template.md
Last active December 12, 2016 23:02 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Migrations

YES | NO

Description

A few sentences describing the overall goals of the pull request's commits.

Related PRs

List related PRs against other branches:

branch | PR

@holmesal
holmesal / pre-pr-checklist.md
Last active April 7, 2017 21:03
Pre-PR Checklist

Pre-PR checklist

Did you add any Typographic components?

If so, come up with a witty name and add the type parameters to the Trello card.

Are you using any icons that don't already exist in /styleguide/icons?

If so, add the SVGs to that folder. Make sure you add both 12 and 24px sizes.

# install audiowaveform
RUN apt-get install -y wget git-core make cmake gcc g++ libmad0-dev libid3tag0-dev libsndfile1-dev libgd2-xpm-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev
WORKDIR ~
RUN git clone https://github.com/bbc/audiowaveform.git
WORKDIR audiowaveform/
RUN wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
RUN tar xzf release-1.8.0.tar.gz
RUN ln -s googletest-release-1.8.0/googletest googletest
RUN ln -s googletest-release-1.8.0/googlemock googlemock
RUN mkdir build
class LinearRegressionModel(nn.Module):
def __init__(self):
super(LinearRegressionModel, self).__init__()
# init the layers
self.layers = nn.Sequential(
# input linear layer
nn.Linear(1, 10),
num_datapoints = 1000
x = np.random.rand(num_datapoints)
# our model will guess m and b:
m = 7;
b = 13;
f = 2;
# high school flashbacks
y = m * x + b;