Skip to content

Instantly share code, notes, and snippets.

View mlg87's full-sized avatar
🇺🇦
Слава Україні

Mason Goetz mlg87

🇺🇦
Слава Україні
View GitHub Profile
@mlg87
mlg87 / findMatchingSimulator.js
Created July 16, 2019 22:28
Fixes a bug in `react-native/local-cli/runIOS/findMatchingSimulator.js`
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
@mlg87
mlg87 / example.ts
Created February 4, 2019 21:56
mock a static class method in jest
// ./SomeClass.ts
export default class SomeClass {
public static myMethod(params: any) {
... do something
}
}
// ./SomeComponent.tsx
async function doSomething(data) {
if(data.ok) {
return await db.insert(data)
}
if(typeof data === 'string') {
return new Alert(data)
}
if(data.type === 'result') {
@mlg87
mlg87 / express_postgress_knex.md
Created January 17, 2019 18:07 — forked from laurenfazah/express_postgress_knex.md
Cheat Sheet: Setting up Express with Postgres via Knex

Express & Postgres via Knex

Note: <example> is meant to denote text replaced by you (including brackets).

Setup

// global dependencies
npm install -g knex