git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| // Get all users | |
| var url = "http://localhost:8080/api/v1/users"; | |
| var xhr = new XMLHttpRequest() | |
| xhr.open('GET', url, true) | |
| xhr.onload = function () { | |
| var users = JSON.parse(xhr.responseText); | |
| if (xhr.readyState == 4 && xhr.status == "200") { | |
| console.table(users); | |
| } else { | |
| console.error(users); |
| updateState({target}) { | |
| this.setState(prevState => { | |
| const updatedUser = {...prevState.user, [target.name]: target.value}; // use previous value in state to build new state... | |
| doSomething(updatedUser); // Now I can safely utilize the new state I've created to call other funcs... | |
| return { user: updatedUser }; // And what I return here will be set as the new state | |
| }); | |
| } |
| function buildReduxContainer(ChildComponentClass, mapStateToProps) { | |
| return class Container extends Component { | |
| render() { | |
| const { state } = this.context.store.getState(); | |
| const props = mapStateToProps(state); | |
| return <ChildComponentClass {...this.props} {...props} />; | |
| } | |
| } |
| // Get binary file using XMLHttpRequest | |
| function getBinary(file) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open("GET", file, false); | |
| xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
| xhr.send(null); | |
| return xhr.responseText; | |
| } | |
| // Base64 encode binary string |
| interface Option<T> { | |
| map <U>(fn: (a: T) => U): Option<U>; | |
| isSome(): boolean; | |
| isNone(): boolean; | |
| isSomeAnd(fn: (a: T) => boolean): boolean; | |
| isNoneAnd(fn: () => boolean): boolean; | |
| unwrap(): T; | |
| unwrapOr(def: T): T; | |
| unwrapOrElse(f: () => T): T; | |
| map<U>(f: (a: T) => U): Option<U>; |
Last updated March 28, 2021
There are now two ways to approach this:
This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions
| -- Get Max ID from table | |
| SELECT MAX(id) FROM table; | |
| -- Get Next ID from table | |
| SELECT nextval('table_id_seq'); | |
| -- Set Next ID Value to MAX ID | |
| SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |