function renderWithRedux(ui, { initialState, store = createStore(rootReducer, initialState) } = {}, renderFn = render) {
const obj = {
...renderFn(<Provider store={store}>{ui}</Provider>),
store,
};
obj.rerenderWithRedux = (el) => renderWithRedux(el, { store }, obj.rerender);
return obj;
This file contains 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
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache |
This file contains 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
Sign Up | |
Credit Card Checkout | |
Landing Page (above the fold) | |
Calculator | |
App Icon | |
User Profile | |
Settings | |
404 page | |
Music Player | |
Social Share |
This file contains 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
class MyListClass{ | |
String value; | |
List<MyItemClass> items; | |
MyListClass(){} | |
MyListClass.fromRaw(Map value){ | |
value = JSON.decode(value['value']); | |
items = JSON.decode(value['items'],reviver:(k,v){ |
This file contains 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 PrivateRoute ({component: Component, authenticated, ...rest}) { | |
return ( | |
<Route | |
{...rest} | |
render={(props) => authenticated === true | |
? <Component {...props} /> | |
: <Redirect to={{pathname: '/login', state: {from: props.location}}} />} | |
/> | |
) | |
} |
This file contains 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
# views.py | |
from rest_framework import exceptions | |
from rest_framework import generics | |
from myapp import models | |
from myapp import serializers as ser | |
class MethodSerializerView(object): | |
''' |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
This file contains 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 'dart:async'; | |
void main() { | |
var data = [1,2,3,4,5]; | |
var stream = new Stream.fromIterable(data); | |
var broadcastStream = stream.asBroadcastStream(); | |
broadcastStream.listen((value) => print("(3)stream.listen: $value")); | |
broadcastStream.first.then((value) => print("(3)stream.first: $value")); // 1 |
This is taken from here. http://stackoverflow.com/questions/67699/how-do-i-clone-all-remote-branches-with-git/72156#72156 Want this as a gist because I always come back to this posting.
First, clone a remote git repository and cd into it:
$ git clone git://example.com/myproject
$ cd myproject
Next, look at the local branches in your repository:
This file contains 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 'dart:math'; | |
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
OlderNewer