This is content converted from Markdown!
Here's a JSON sample:
{
"foo": "bar"
}| <html> | |
| <head> | |
| <style> | |
| h1 { | |
| font-family: Calibri; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Hello World!</h1> |
| xcode-select --install | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew update | |
| brew cask install iterm2 | |
| # update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts | |
| brew install bash # latest version of bash | |
| # set brew bash as default shell | |
| sudo nano /etc/shells | |
| # add /usr/local/bin/bash to the accepted list of shells | |
| chsh -s /usr/local/bin/bash |
| import { useState } from "react"; | |
| export function useLocalStorage<T>(key: string, initialValue: T): [T, (s: T) => void] { | |
| // State to store our value | |
| // Pass initial state function to useState so logic is only executed once | |
| const [storedValue, setStoredValue] = useState<T>(() => { | |
| try { | |
| // Get from local storage by key | |
| const item = window.localStorage.getItem(key); | |
| // Parse stored json or if none return initialValue |
| import React from 'react' | |
| const withDefaults = <P, DP>(component: React.ComponentType<P>, defaultProps: DP) => { | |
| type Props = Partial<DP> & Omit<P, keyof DP> | |
| component.defaultProps = defaultProps | |
| // @ts-ignore | |
| return component as React.ComponentType<Props> | |
| } | |
| export default withDefaults |
| function arrayBufferToBase64(buffer:ArrayBuffer) { | |
| let binary = '' | |
| const bytes = new Uint8Array(buffer) | |
| bytes.forEach(b => (binary += String.fromCharCode(b))) | |
| return window.btoa(binary) | |
| } |
| git config remote.origin.push HEAD |