Skip to content

Instantly share code, notes, and snippets.

View stackdumper's full-sized avatar

Elijah A. stackdumper

View GitHub Profile
@stackdumper
stackdumper / unwrap.ts
Created August 31, 2018 11:00
Unwrap promise
export type Resolved<T> = T extends Promise<infer U> ? U :
T extends (...args: any[]) => Promise<infer U> ? U :
T
@stackdumper
stackdumper / android_instructions.md
Created August 23, 2018 15:04 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

import * as React from 'react'
import { Redirect } from 'react-router-dom'
import queryString from 'qs'
export const withRedirect = <P extends Object>(
reaction: (any) => boolean,
redirect: string | ((props: P) => string),
) => (WrappedComponent) => {
const WithRedirectWrapper = (props: P) => {
@stackdumper
stackdumper / vscode-custom-styles.css
Last active December 21, 2019 22:41
vscode custom styles
.editor-actions, .title-actions {
display: none !important;
}
const hex = process.argv[2];
const getInt = char =>
({
A: '10',
B: '11',
C: '12',
D: '13',
E: '14',
F: '15'
@stackdumper
stackdumper / dec2hex.js
Last active May 21, 2018 07:29
dec2hex
let dec = process.argv[2];
let result = '';
const getChar = char =>
({
'10': 'A',
'11': 'B',
'12': 'C',
'13': 'D',
'14': 'E',
{
"workbench.startupEditor": "newUntitledFile",
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"workbench.colorTheme": "City Lights",
"editor.fontSize": 18,
"editor.folding": false,
"editor.hideCursorInOverviewRuler": true,
"editor.lineHeight": 26,
import React, { Component } from 'react';
import { NavigationActions } from 'react-navigation';
import { reaction } from 'mobx';
import { inject, observer } from 'mobx-react';
const navigateWithReset = (navigation, targetRoute) => {
const resetAction = NavigationActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: targetRoute })],
});
@stackdumper
stackdumper / index.js
Created April 29, 2018 17:31
react-coolkeys
import React, { Component } from 'react'
import Mousetrap from 'mousetrap'
const KeymapContext = React.createContext()
export const CoolKeysProvider = ({ keymap, children }) => (
<KeymapContext.Provider value={keymap}>{children}</KeymapContext.Provider>
)
@stackdumper
stackdumper / eslintrc.yaml
Created April 15, 2018 07:01
Eslint react sort comp
react/sort-comp:
- warn
-
order:
- static-methods
- constructor
- lifecycle
- /^on.+$/
- /^handle.+$/
- getters