This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a gist! | |
Template.yourtemplate.helpers | |
hola: -> | |
"hello world" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Inmates.find | |
$or:[ | |
{ | |
first_name: | |
$regex:search | |
$options:"i" | |
} | |
{ | |
last_name: | |
$regex:search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from 'react'; | |
import { ScrollView, TextInput } from 'react-native'; | |
// Parent Component | |
class Card extends Component { | |
handleFocus = (y) => { | |
this.scrollView.scrollTo({ y }); | |
} | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, PropTypes } from 'react'; | |
import { ScrollView, TextInput } from 'react-native'; | |
// Parent Component | |
class Card extends Component { | |
static childContextTypes = { | |
handleFocus: PropTypes.func, | |
} | |
getChildContext = () => ({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |