Skip to content

Instantly share code, notes, and snippets.

View chrisl777's full-sized avatar

Chris Livdahl chrisl777

View GitHub Profile
@tuantvk
tuantvk / react-native-mobx-context.js
Last active April 20, 2021 17:06
Example for React Native use Mobx and React Context
// store/pokemon.store.js
import {
get,
computed,
action,
makeAutoObservable,
createTransformer,
} from "mobx";
class PokemonStore {
@aqrojo
aqrojo / ReactComponents.js
Created April 7, 2021 22:55
mobx-introduction_04_observer
import { observable } from 'mobx'
import { observer } from 'mobx-react'
const store = observable({
prop1: 1,
prop2: 2,
...
})
function ComponentA () {
@cnicodeme
cnicodeme / fixes.md
Last active May 8, 2024 18:03
List of 5,000 Most Frequently Used Domain Name Prefixes and Suffixes - Ordered By Length
@sangkukbae12
sangkukbae12 / mobx_observable_actions.js
Created April 27, 2020 23:03
react mobx obervable with actions
// Bound Actions
import { observable } from "mobx";
class Counter {
@observable count = 0;
@action.bound
increment() {
this.count++;
}
}
const counter = new Counter();
@hellendag
hellendag / mergeResolvers.js
Last active November 20, 2023 19:16
Merge mocked GraphQL resolvers
// @flow
type ResolvedScalar = string | number | boolean | null;
type ResolvedValue =
| ResolvedScalar
| Array<ResolvedValue>
| {[key: string]: ResolvedValue};
type ResolverFunction = (...args: Array<any>) => ResolvedValue;
export type ResolverMap = {
@cellularmitosis
cellularmitosis / EmojiPointersDemo.swift
Created August 15, 2018 18:11
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
@adrianhall
adrianhall / AppSyncAPI.yaml
Last active March 19, 2023 14:57
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
@muZk
muZk / README.md
Created December 12, 2017 16:42
How to use hover with react-jss

How to use hover with react-jss

Let's say we have the following style:

const styles = (theme) => ({
  title: {
    color: theme.color,
  },
})
@ahbou
ahbou / Storage.swift
Created September 17, 2017 10:23 — forked from saoudrizwan/Storage.swift
Helper class to easily store and retrieve Codable structs from/to disk. https://medium.com/@sdrzn/swift-4-codable-lets-make-things-even-easier-c793b6cf29e1
import Foundation
public class Storage {
fileprivate init() { }
enum Directory {
// Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the <Application_Home>/Documents directory and will be automatically backed up by iCloud.
case documents
@nblackburn
nblackburn / camelToKebab.js
Last active December 15, 2023 03:19
Convert a string from camel case to kebab case.
module.exports = (string) => {
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
};