| id | name |
|---|---|
| 1 | Jane |
| 2 | Max |
| 3 | John |
| 4 | Scott |
| package enum_example | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| ) | |
| // TaskState represents the state of task, moving through Created, Running then Finished or Errorred | |
| type TaskState int |
| export default class WebStorage { | |
| constructor(key, storageArea = window.localStorage) { | |
| this.key = key; | |
| this.storageArea = storageArea; | |
| } | |
| load(defaultValue) { | |
| const serialized = this.storageArea.getItem(this.key); | |
| return serialized === null ? defaultValue : this.deserialize(serialized); | |
| } |
Authorization and Authentication are hard. when you only have to implement them once (as you do within a monolith) instead of over and over again, it makes the developer happy :-), and maybe leads to less implementation failures.
When you have a bunch of microservices, this is something that has to be considered.
Implement it once or in every microservice, or something in between?
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
| . | |
| ├── books | |
| │ ├── handlers.go | |
| │ └── models.go | |
| ├── config | |
| │ └── db.go | |
| └── main.go |
In order to access a server hosted within a vm (guest), for development purposes from the host OS, which is restricted to same origin / localhost only requests, I set up a siple nginx reverse proxy to forward my requests.
- To install in a Windows VM, download and install nginx from the current, stable release; I installed to C:\nginx\
- Edit the <install path>/conf/nginx.conf file with the marked changes in the file of the same name in this gist.
- Start the nginx executable, located in your install path. There are service wrappers for Windows, or you can just kill the process to stop the nginx instance.