Skip to content

Instantly share code, notes, and snippets.

View export-mike's full-sized avatar
📱
GO, React, React Native, Node.js in Syndey Australia

Mike James export-mike

📱
GO, React, React Native, Node.js in Syndey Australia
View GitHub Profile
@export-mike
export-mike / mcc.json
Last active April 21, 2023 10:45
Stripe MCC.json - https://stripe.com/docs/connect/setting-mcc collected using pup, jq and some manual replacements.
[{
"code": "ac_refrigeration_repair",
"value": "7623",
"name": "A/C Refrigeration Repair"
},
{
"code": "accounting_bookkeeping_services",
"value": "8931",
"name": "Accounting/Bookkeeping Services"
},
@export-mike
export-mike / machine.js
Last active April 3, 2023 02:19
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'onboarding',
initial: 'nilApplication',
context: {
retries: 0
},
states: {
invest: {
@export-mike
export-mike / main.go
Created September 16, 2022 01:28
generate cert pem and key pem
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"log"
{
"XHKG": [
{
"date": 20220201,
"name": "Lunar New Year 1"
},
{
"date": 20220202,
"name": "Lunar New Year 2"
},
package main
import (
// "bytes"
"fmt"
)
func main() {
type Mapping struct {
symbol string
@export-mike
export-mike / compose-async.js
Last active June 30, 2020 22:30
compose utility function for async await, A team effort with @cameronbourke and @gwyneplaine. It was a fun discussion.
/*
* Requires Node 8+
* Works in chrome, simply copy and paste into console.
*/
const R = require('ramda');
const compose =
(...funcs) =>
(...args) =>
funcs.reduceRight(async (a, f) => {
@export-mike
export-mike / index.js
Created June 18, 2018 08:22
Unstated Offline Container
import * as Unstated from 'unstated';
import debounce from 'lodash.debounce';
import clonedeep from 'lodash.clonedeep';
import { Alert } from 'react-native';
import AsyncStorage from '../AsyncStorage';
const noop = () => {};
//set FS storage limit for android: https://codedaily.io/tutorials/4/Increase-Android-AsyncStorage-Size-in-React-Native
export class Container extends Unstated.Container {
debounce = 800;
constructor({ key } = {}) {
// Before with a higher order component.
import React from 'react';
class UserCreateEdit extends React.Component {
constructor(props) {
super(props);
this.state = {
user: props.user
}
}
@export-mike
export-mike / Example.js
Created November 22, 2017 04:29
DataLoadingViaRenderProps
import React from 'react';
import Tile from './Tile';
import {WithRequest} from './withRequest';
import Api from '../Api';
import Loading from './Loading';
const OnBoardingTemplates = () => <Tile
title="Users"
to="/users"
actionLabel="Add New"
@export-mike
export-mike / config.yml
Created November 15, 2017 23:45
circleCI yarn cache
steps:
- checkout
- restore_cache:
keys:
# Find a cache corresponding to this specific yarn.lock checksum
# when this file is changed, this key will fail
- v1-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: install-yarn
command: npm install -g yarn@v0.24.5