Skip to content

Instantly share code, notes, and snippets.

import Fields from 'graphql-fields';
import isEmpty from 'lodash/isEmpty';
import q from '~/config/q';
import dataPage from '~/utils/dataPage';
import geocode from '~/utils/geocode';
export default async function devices(root, props, context, info) {
const {
db,
ownerId,
@Lepozepo
Lepozepo / Dockerfile
Created January 3, 2019 18:55
Not so automatic meteor now deployment
FROM node:8.9.4
LABEL name="hermes"
COPY . /usr/src/app/
WORKDIR /usr/src/app
RUN cat *sf-part* > bundle.tar.gz
RUN tar -xzf bundle.tar.gz
WORKDIR bundle/programs/server
RUN npm install
import { Component, PropTypes } from 'react';
import { ScrollView, TextInput } from 'react-native';
// Parent Component
class Card extends Component {
static childContextTypes = {
handleFocus: PropTypes.func,
}
getChildContext = () => ({
@Lepozepo
Lepozepo / react-without-context-coupling.jsx
Created January 13, 2017 16:29
React without Context Coupling
import { Component } from 'react';
import { ScrollView, TextInput } from 'react-native';
// Parent Component
class Card extends Component {
handleFocus = (y) => {
this.scrollView.scrollTo({ y });
}
render() {
@Lepozepo
Lepozepo / stringifyReviveWithFunctions.js
Created October 19, 2016 19:20
Stringify and revive with functions
function stringifyWithFunctions(object) {
return JSON.stringify(object, (key, val) => {
if (typeof val === 'function') {
return `(${val})`; // make it a string, surround it by parenthesis to ensure we can revive it as an anonymous function
}
return val;
});
};
function parseWithFunctions(obj) {
has_not_run = true
Template.rendered ->
if Router.current()
destination = "Template.#{Router.current().route.options.template or Router.current().route.name}"
current = @view.name
if destination is current and has_not_run
has_not_run = false
document.addEventListener "deviceready", ->
Session.set "cordova.deviceready",true
Inmates.find
$or:[
{
first_name:
$regex:search
$options:"i"
}
{
last_name:
$regex:search
# This is a gist!
Template.yourtemplate.helpers
hola: ->
"hello world"