Skip to content

Instantly share code, notes, and snippets.

@nnance
nnance / index.tsx
Created May 14, 2020 18:01
Bootstrap Full Height React
function App() {
return (
<Container fluid style={{ height: "100vh" }}>
<Row style={{ height: "100%" }}>
<Col
style={{ background: "yellow", height: "100%", paddingTop: "15px", paddingBottom: "15px" }}
>
Col 1
</Col>
<Col style={{height: "100%", paddingTop: "15px", paddingBottom: "15px" }}>
@nnance
nnance / .eslint.json
Last active April 26, 2020 14:48
React TypeScript Bootstrap Parcel prototype template
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
]
@nnance
nnance / create-react-ts.sh
Created April 12, 2020 13:06
React TypeScript prototype template
git init && npm init -y
npm i -D @types/react @types/react-dom live-server typescript
tsc --init --module system --moduleResolution node --jsx react --sourceMap --esModuleInterop --target es5 --lib es6,dom --outFile ./dist/index.js
curl https://raw.githubusercontent.com/nnance/react-ts-basic-starter/master/.gitignore > .gitignore
curl https://raw.githubusercontent.com/nnance/react-ts-basic-starter/master/index.html > index.html
curl https://raw.githubusercontent.com/nnance/react-ts-basic-starter/master/index.tsx > index.tsx
@nnance
nnance / .eslintignore
Last active October 30, 2021 10:21
Create React App with ESLint, TypeScript, Prettier
src/serviceWorker.ts
@nnance
nnance / del_node_modules.sh
Created October 6, 2019 23:52 — forked from gordlea/del_node_modules.sh
delete node_modules recursively
#!/bin/bash
# taken from https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
find . -name "node_modules" -exec rm -rf '{}' +
@nnance
nnance / json.ts
Created September 7, 2019 23:20
JSON TypeScript Interface
type AnyJson = boolean | number | string | null | JsonArray | JsonMap;
interface JsonMap { [key: string]: AnyJson; }
interface JsonArray extends Array<AnyJson> {}
@nnance
nnance / gist:08d552c31da40f6224d994e3c426a768
Last active February 4, 2019 20:56
Make NVM lazy load
nvm() {
unset -f nvm
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm "$@"
}
node() {
unset -f node
@nnance
nnance / homebridge
Last active November 19, 2018 16:11 — forked from johannrichard/homebridge
Systemd Service for homebridge (http://github.com/nfarina/homebridge)
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@nnance
nnance / gdax-stream.js
Created May 14, 2017 17:03
GDAX WebSocket Rolling Stats
'use strict'
const Gdax = require('gdax')
const h = require('highland')
const streamStatistics = require('stream-statistics')
const newClient = (markets = ['BTC-USD']) => new Gdax.WebsocketClient(markets)
const websocket = newClient()
{
me {
id,
name,
age,
friends {
id,
name,
age
}