| Name | Henge Docks - Horizontal Docking Station | Henge Docks - Tethered Dock | TS3 Lite CalDigit | TS3 CalDigit | Thunderbolt 3 Express Dock HD | Plugable TB3 | Elgato TB 3 Dock | OWC Thunderbolt 3 Dock | |----------------|--
View redux_types.js
import type { GlobalState } from 'redux/modules'; | |
export type ExtractReturn<Fn> = $Call<<T>((...Iterable<any>) => T) => T, Fn>; | |
// ... | |
export type BaseAction = $ReadOnly<{ type: string, error?: boolean }>; | |
// ... |
View ConvertStyles.re
open Belt; | |
let teststring = {| | |
"container": | |
style([ | |
flex(1.0), | |
backgroundColor(Colors.darkBackground), | |
justifyContent(SpaceBetween), | |
alignItems(Center), | |
overflow(Hidden), |
View like-posts.php
add_action( 'graphql_register_types', function() { | |
register_graphql_field( 'Post', 'likeCount', [ | |
'type' => 'Int', | |
'description' => __( 'The number of likes for the post', 'your-textdomain' ), | |
'resolve' => function( $post ) { | |
$likes = get_post_meta( $post->ID, 'likes', true ); | |
return isset( $likes ) ? (int) $likes : 0; | |
} | |
] ); |
View gist:1e08ba6e9136b7d74a2cc57b5ce1bf10
type error('err) = | |
| NetworkError | |
| ExpectedJson | |
| ParseError('err); | |
/** | |
* Map one kind of Belt.Result.Error into another kind of Belt.Result.Error | |
* e.g. (('err => 'otherError), Belt.Result.t('a, 'err)) => Belt.Result.t('a, 'otherError) | |
*/ | |
let mapErr = (fn, r) => switch r { |
View 0-bridging-react-native-cheatsheet.md
Bridging Native & React for iOS & Android
js -> native
native -> js
View MainApplication.java
package com.teslamotors.TeslaApp; | |
import android.app.Application; | |
import com.BaiduMaps.BaiduPackage; | |
import com.airbnb.android.react.maps.MapsPackage; | |
import com.facebook.react.ReactApplication; | |
import com.facebook.react.ReactNativeHost; | |
import com.facebook.react.ReactPackage; | |
import com.facebook.react.shell.MainReactPackage; | |
import com.i18n.reactnativei18n.ReactNativeI18n; |
View README.md
React Native Trouble
Updating to macOS Sierra is causing trouble with React Native due to some of the Node.js and system utilities it uses. Specifically the watch utility fails due to a limit on the number of files which can be opened at a time.
The following command shows the current limit.
launchctl limit maxfiles
View fetch-from-contentful.js
#!/usr/bin/env babel-node | |
require('dotenv').config() | |
import contentful from 'contentful' | |
import fs from 'fs-extra-promise' | |
// Contentful Config | |
const apiToken = process.env.CONTENTFUL_DELIVERY_API_TOKEN | |
const spaceId = process.env.CONTENTFUL_SPACE_ID | |
const client = contentful.createClient({ accessToken: apiToken, space: spaceId }) |
View README.md
Usage
node dirtyserve.js
The point your browser to
http://localhost:3000/myfile.xxx
and the server will try to serve that file from the local server.
NewerOlder