Skip to content

Instantly share code, notes, and snippets.

View AgtLucas's full-sized avatar
🌎
💀⏳🌷

Lucas AgtLucas

🌎
💀⏳🌷
View GitHub Profile
@sibelius
sibelius / flow-redux.guideline.md
Created November 10, 2017 16:23
How to easily type Redux Props with Flow

How to easily type Redux Props with Flow

Add ExtractReturn helper

// https://hackernoon.com/redux-flow-type-getting-the-maximum-benefit-from-the-fewest-key-strokes-5c006c54ec87
// https://github.com/facebook/flow/issues/4002
// eslint-disable-next-line no-unused-vars
type _ExtractReturn<B, F: (...args: any[]) => B> = B;
export type ExtractReturn = _ExtractReturn&lt;*, F&gt;;
@staltz
staltz / .bashrc
Created October 16, 2017 12:42
Put this in your ~/.bashrc (or equivalent) file. Then run `reactnativedev "192.168.1.101:8081"`
# Tweak tap coordinates as you wish
function reactnativedev() {
adb shell input keyevent 82;
sleep 0.1;
adb shell input tap 150 1401;
sleep 0.1;
adb shell input tap 150 1401;
sleep 0.1;
adb shell input text "$1";
sleep 0.1;
@markerikson
markerikson / reactiflux-actions-action-creators-mapDispatch.md
Last active April 14, 2018 21:03
Reactiflux chat: Dispatching actions, using reducers, action creators, and mapDispatchToProps

[10:39 AM] infected mushroom: Is this analogy correct?

Can we say that the store in the Redux app is like a database?
mapStateToProps is used to retrive (read) the information from the database where as
mapDispatchToProps is used to write the information in the same database?
[10:59 AM] infected mushroom: Okay, I am confused now

On official docs it says

Actions are payloads of information that send data from your application to your store

@busypeoples
busypeoples / PhantomTypeReasonML.md
Last active February 6, 2024 21:29
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@HenrikJoreteg
HenrikJoreteg / native-virtual-dom.js
Last active December 18, 2020 15:34
Native virtual dom?
// what if this was something browsers just gave us?
const { vdom } = document;
// this is same idea as React.createElement
// or any of the other similar appraoches
const newVirtualDom = vdom('div', {className: 'some-class'}, [
vdom('p', null, 'hi')
])
// if preferred, someone could easily use JSX and precompile it
@busypeoples
busypeoples / README.md
Last active February 8, 2022 08:41
Making Impossible States Impossible in ReasonML

Making Impossible States Impossible in ReasonML

Introduction

If you have already seen Richard Feldman's talk entitled "Making Impossible States Impossible" or have read "Designing with types: Making illegal states unrepresentable" then you can skip the explanations and just head straight to the Reason examples.

This post is intended to display how to model your Reason Application to prevent creating impossible states. The benefits of being able to design a feature in this way include avoiding having to deal with complex test scenarios regarding defined business rules and a clear documentation of what is possible just by looking at the type definition. Long story short, let's see how this all works by implementing an example.

Requirements

@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

FROM ibmcom/swift-ubuntu:latest
LABEL name swift-vapor
RUN mkdir /App
WORKDIR /App
COPY . /App
@kitten
kitten / reactiveconf-sc-cfp.md
Last active November 17, 2020 15:06
ReactiveConf 2017 Lightning Talk CFP: With styled-components into the future

styled-components Logo

With styled-components into the future

Preprocessing is dead, long live preprocessing!


This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf

@andywer
andywer / talk-proposal.md
Last active December 23, 2020 17:22
Reactive Conf 2017 ⚡️ Talk Proposal - Memory Leak Hunt 2017 Style

This is a proposal for lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal!

Memory Leak Testing in 2017

Hi, I am Andy, creator of leakage - the node-powered memory leak testing library.

Instead of manual debugging it provides a structured approach to fix or even prevent memory leaks.