Skip to content

Instantly share code, notes, and snippets.

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

Mike grabbou

💭
🇦🇪🇺🇸
View GitHub Profile
#import "ActivityView.h"
#import "RCTLog.h"
#import "RCTBridge.h"
#import "RCTUtils.h"
#import "RCTUIManager.h"
@implementation ActivityViewManager
@synthesize bridge = _bridge;
import {ActivityViewManager} from 'NativeModules';
ActivityViewManager.share({
text: 'Hey, I have just ordered 10 pizzas from RN app',
exclude: ['airDrop', 'postToFacebook']
});
import {ActivityViewManager} from 'NativeModules';
ActivityViewManager.share({
text: 'Hey, I have just ordered 10 pizzas from RN app'
});
// will be caught by promise-middleware
function makeASandwichWithSecretSauce(name) {
return {
types: [],
payload: fetch(...)
}
};
// This is complex one
// BTW, you don't have redux-thunk
@grabbou
grabbou / das.js
Created September 30, 2015 13:49
#!/usr/bin/env node
// Deps
var chain = require('slide').chain;
var path = require('path');
var ln = require('linklocal');
var exec = require('./exec');
var program = require('commander');
var linklocal = require('linklocal');
@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
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 / 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 {
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}) => ({
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
}