Skip to content

Instantly share code, notes, and snippets.


Gerard Sychay hellogerard

View GitHub Profile
hellogerard / journal.stories.js
Created November 16, 2017 16:31
"Live" React Native Storybook story
View journal.stories.js
/* eslint-disable import/no-unresolved, indent */
import React from 'react';
import { ScrollView } from 'react-native';
import { gql, graphql, ApolloProvider } from 'react-apollo';
import { storiesOf } from '@storybook/react-native';
import { compose, withStateHandlers, withProps, branch, renderNothing } from 'recompose';
import { get } from 'lodash';
import store from '/app/store';
import client, { networkInterface } from '/app/client';
View why-did-you-update.js
/* eslint-disable no-console */
import _ from 'lodash';
// Drop this into a component that wastes time according to Perf.printWasted()
// to find out what state/props should be preserved. Once it says "Update
// avoidable!" for {state, props}, you should be able to drop in
// React.addons.PureRenderMixin or React.PureComponent.
// From:
hellogerard / animals.js
Last active March 8, 2017 18:26
Functional JS approach to classic Animals OO example -
View animals.js
const animal = {
type: 'animal',
talk() {
alert('Hello, world!');
move() {
alert(`${} the ${this.type} moved forward`);
hellogerard /
Created May 30, 2014 15:26
Importing static data on Meteor startup.
# Using 'node-csv-npm' meteorite package
fs = Npm.require 'fs'
Meteor.startup ->
hellogerard / publications.js
Last active August 27, 2020 05:23
Publishing results of a REST API call in Meteor.
View publications.js
// I need to integrate my company's meteor app with a 3rd party legacy application. Both apps will operate independently, but need to perform CRUD on the legacy datasource. Is there a way to use a REST api built on the legacy system as a datasource in the meteor app?
//Basically I'm looking to do something like the below pseudocode:
Meteor.publish("items", function() {
HTTP.get('',{ },function(err, items){
return items;
//Or return items.toMeteorCollection()
hellogerard /
Last active August 29, 2015 13:59
Modifying/transforming a Meteor collection cursor in a publication
# Our minimongoid 'List' class, wrapping the 'lists' Meteor.Collection
# (runs on server & client). If not using minimongoid, you could simply
# on the server & client use:
# Lists = new Meteor.Collection 'lists'
class @List extends Minimongoid
@_collection: new Meteor.Collection 'lists'
hellogerard / cow.html
Last active August 29, 2015 13:58
[blaze] Meteor autofocus reactivity bug (
View cow.html
{{> hello}}
<template name="hello">
<h1>Hello World!</h1>

Keybase proof

I hereby claim:

  • I am hellogerard on github.
  • I am hellogerard ( on keybase.
  • I have a public key whose fingerprint is C4A1 AA18 EDF3 05A2 735F 8BCF 00F2 8592 CE51 9826

To claim this, I am signing this object: