Skip to content

Instantly share code, notes, and snippets.

View grabbou's full-sized avatar
💭
🇦🇪🇺🇸

Mike grabbou

💭
🇦🇪🇺🇸
View GitHub Profile
import {Router} from 'express';
import {wrap} from '../../utils';
const router = Router();
async function getAllChampagnes(req, res) {
const champagnes = await req.db.models.Champagne
.find()
.exec();
import PureRender from '../decorators/pureRender';
import React from 'react-native';
import autobind from 'autobind-decorator';
import {
TextInput,
Text,
View
} from 'react-native';
import style from './input.style';
@grabbou
grabbou / gist:0f701bc2c081ea41a947
Last active August 29, 2015 14:25
ES6 in React-Native
import {
View
} from 'react-native';
// not rewritten to react-native/....../react-native.js, cannot find module 'react-native';
// output looks like
// var _reactNative=require(
//
//
//'react-native');
// note line breakes in output
import DocumentTitle from 'react-document-title';
import Html from './html.react';
import Promise from 'bluebird';
import React from 'react';
import Router from 'react-router';
import config from '../config';
import immutable from 'immutable';
import initialState from '../initialstate';
import routes from '../../client/routes';
import stateMerger from '../lib/merger';
import KeyboardEvents from 'react-native-keyboardevents';
import PureRender from './pureRender';
import React, {Animated} from 'react-native';
import {autobind} from 'core-decorators';
import {Emitter as KeyboardEventEmitter} from 'react-native-keyboardevents';
export default function makeDecorator(factor = 2.5) {
return function trackKeyboard(Component) {
import React, {Animated, View, Text} from 'react-native';
import TrackKeyboard from '../decorators/trackKeyboard';
@TrackKeyboard(1)
export default class Login extends React.Component {
static propTypes = {
animations: React.PropTypes.object.isRequired
}
export default function injectDependencies({dependencies}) {
return({dispatch, getState}) => next => action =>
typeof action === 'function' ?
action({...dependencies, getState}) :
next(action);
}
// action
export function fetchOrders(orderId) {
return ({fetch}) => ({
@grabbou
grabbou / d.js
Last active September 17, 2015 08:25
export const currentCustomer = ({router, order, customer}) => {
const customerId = router.params.customerId; // zależy jak masz w <Route path="/customers/:customerId" />
const currentCustomer = customer.list
? customer.list.find(customer => customer._id === customerId)
: null;
const currentCustomerOrders = order.list
? order.list.filter(order => order.user._id === customerId)
: null;
return {
This file has been truncated, but you can view the full file.
2015-09-21 23:20:17.513 pfc-mobile[3682:148885] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
Stack:(
0 CoreFoundation 0x00000001065f9f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105c10deb objc_exception_throw + 48
2 CoreFoundation 0x00000001065f9e9d +[NSException raise:format:] + 205
3 Foundation 0x00000001059852e5 _AssertAutolayoutOnMainThreadOnly + 79
4 Foundation 0x00000001057e5ece -[NSISEngine withBehaviors:performModifications:] + 31
5 UIKit 0x00000001042c57a6 -[UIView(Hierarchy) layoutBelowIfNeeded] + 510
6 UIKit 0x0000000104757138 -[_UIAlertControllerActionView _updateBackgroundView] + 432
7 UIKit 0x0000000104757f34 -[_UIAlertCon
@grabbou
grabbou / ds.sh
Created September 29, 2015 20:23
#!/bin/bash
cd web
mkdir -p ./node_modules/@este
(
cd ./node_modules/@este
rm -rf ./common
ln -s ../../../common ./common