Skip to content

Instantly share code, notes, and snippets.

View sync's full-sized avatar

Anthony Mittaz sync

View GitHub Profile
@joshuayoes
joshuayoes / new-architecture.md
Created October 5, 2022 23:51
A collection of documentation, repositories, and videos about the New Architecture in React Native
@aleclarson
aleclarson / rollup-typescript.md
Last active May 6, 2024 19:37
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@wokalski
wokalski / Form.re
Last active August 23, 2020 05:58
sensible forms for reason-react
type validatorData('a) = {
value: 'a,
isTouched: bool,
submitted: bool,
};
type shouldDisplayError('error) = {
error: 'error,
isTouched: bool,
submitted: bool,
@painedpineapple
painedpineapple / Downshift.re
Last active November 5, 2019 22:06
bs-downshift-hooks
/** Developed with "downshift": "^3.4.1" */
type highlightedIndex = int;
type isOpen = bool;
[@bs.module "downshift"] [@bs.scope "useSelect"]
external stateChangeTypes: {
.
"MenuKeyDownArrowDown": string,
"MenuKeyDownArrowUp": string,
@wokalski
wokalski / Ppx_driver_with_bucklescript.md
Created August 26, 2019 07:38
How to run a driver based ppx with bucklescript
  1. Create a dune file:
(library
 (public_name aggregate_ppx_name)
 (kind ppx_rewriter)
 (libraries ppx_deriving_protobuf other_ppx another_ppx))
  1. Build:
dune build --profile release
@jaredly
jaredly / example.re
Created July 30, 2019 04:25
Reason Macros example
// Reason Macros!
// Use templates to write your code for you.
let%macro add5 = (input: ident, log: string) => {
if%eval (env("node_environment") != "production") {
Js.log(eval__input)
};
eval__input + 5
};
@lelandrichardson
lelandrichardson / react-native.js
Last active July 21, 2022 17:56
React Native flow types
declare var __DEV__: boolean;
declare module 'react-native' {
declare type Color = string | number;
declare type Transform =
{ perspective: number } |
{ scale: number } |
{ scaleX: number } |
@ericnograles
ericnograles / ButtonWithActivityIndicator.js
Last active January 2, 2017 23:39
A Generic React Native component that allows for a button with an ActivityIndicator when the attached loading prop is true
import React from 'react';
import { View, Text, ActivityIndicator, TouchableOpacity } from 'react-native';
export default class ButtonWithActivityIndicator extends React.Component {
render() {
const { buttonStyle, textStyle, label, onPress, activityIndicatorSize, activityIndicatorColor, loading } = this.props;
return (
<TouchableOpacity style={buttonStyle} onPress={() => {
if (!loading) {
return onPress();
@coleturner
coleturner / camel_case_argument_middleware.rb
Last active February 22, 2018 18:21
Parses camelCase arguments into snake_case for GraphQL Ruby
class CamelCaseMiddleware
def call(parent_type, parent_object, field_definition, field_args, query_context, next_middleware)
next_middleware.call([parent_type, parent_object, field_definition, transform_arguments(field_args), query_context])
end
def transform_arguments(field_args)
transformed_args = {}
types = {}
field_args.each_value do |arg_value|
@seantempesta
seantempesta / routing.cljs
Created April 11, 2016 16:52
An example of using react-native-router-flux with reagent
(defstate ReactNativeRouterFlux :start (js/require "react-native-router-flux"))
(defstate TabBar :start (.-TabBar @ReactNativeRouterFlux))
(defstate Actions :start (.-Actions @ReactNativeRouterFlux))
(defstate Modal :start (.-Modal @ReactNativeRouterFlux))
(defstate Reducer :start (.-Reducer @ReactNativeRouterFlux))
(defstate router :start (r/adapt-react-class (.-Router @ReactNativeRouterFlux)))
(defstate scene :start (r/adapt-react-class (.-Scene @ReactNativeRouterFlux)))
(defn reducerCreate [params]
(let [defaultReducer (@Reducer params)]