Skip to content

Instantly share code, notes, and snippets.

@fleepgeek
fleepgeek / animated_indexed_stack.dart
Created November 8, 2020 21:49
Animated IndexedStack
import 'package:flutter/material.dart';
class AnimatedIndexedStack extends StatefulWidget {
final int index;
final List<Widget> children;
const AnimatedIndexedStack({
Key key,
this.index,
this.children,
import 'package:flutter/material.dart';
class FadeIndexedStack extends StatefulWidget {
final int index;
final List<Widget> children;
final Duration duration;
const FadeIndexedStack({
Key key,
this.index,
@fleepgeek
fleepgeek / tween_and_curve_simulator.dart
Created September 16, 2020 21:58 — forked from funwithflutter/tween_and_curve_simulator.dart
Flutter example to demonstrate the chaining of Tweens and Cuves, plus creating your own Curves and Tweens classes.
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@fleepgeek
fleepgeek / clone_remote_branch.md
Created June 29, 2020 17:19 — forked from ff6347/clone_remote_branch.md
clone remote branch with git
@fleepgeek
fleepgeek / broadcast_basic.dart
Created October 2, 2019 16:51 — forked from hyamamoto/broadcast_basic.dart
Snippets to show basic use of "Dart Stream API" in case I forget. (written for dart-1.3.0-dev)
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
@fleepgeek
fleepgeek / gist:93cec4ecdbb2dfc98e4d10ab21d40305
Created September 6, 2019 13:03 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :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:
@fleepgeek
fleepgeek / react-testing-library--renderWithRedux.md
Last active November 26, 2020 22:16 — forked from darekzak/react-testing-library--renderWithRedux.md
An Improvement to renderWithRedux helper function to enable rerender

Basic Implmentation

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;
@fleepgeek
fleepgeek / views.py
Created June 24, 2019 15:42 — forked from unpluggedcoder/views.py
Use corresponding serializer class for different request method in Django Rest Framework - Part 3
# 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):
'''
@fleepgeek
fleepgeek / routes.js
Created May 7, 2019 16:52 — forked from rcanepa/routes.js
Private routes with React Router v4
function PrivateRoute ({component: Component, authenticated, ...rest}) {
return (
<Route
{...rest}
render={(props) => authenticated === true
? <Component {...props} />
: <Redirect to={{pathname: '/login', state: {from: props.location}}} />}
/>
)
}
@fleepgeek
fleepgeek / JSON_Encode_Decode.dart
Created November 14, 2018 22:12 — forked from Vloz/JSON_Encode_Decode.dart
Example of use of reviver and toEncodable functions, to encode and decode a JSON with a List of Object in dart
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){