This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func fn(w http.ResponseWriter, r *http.Request) { | |
q := r.URL.Query() | |
fmt.Fprintf(w, "Hello " + q.Get("name")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
WARNING: This product can expose you to chemicals including abestos, | |
which is known to the State of California to cause cancer and birth | |
defects or other reproductive harm. | |
For more information go to www.P65Warnings.ca.gov. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = [4,4,0,0,2,3,1,2,2] | |
let i = 0 | |
let mostFreqK = 0 | |
while (i < a.length) { | |
if (a[i] < 0) { | |
i++ | |
continue | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://golang.org/pkg/sort/#Slice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config/index.js | |
dev: { | |
// ... | |
assetsPublicPath: './', | |
// ... | |
}, | |
build: { | |
// ... | |
assetsPublicPath: './', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1 id="lilpump"></h1> | |
<script> | |
const url = "PUT THE URL HERE" | |
fetch(url) | |
.then(response => response.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
First we must call the API. | |
We can do that by using the built-in ES6 function called fetch. | |
Fetch simply takes an end point (in this case, the URL that is in quotes). | |
*/ | |
fetch('https://jsonplaceholder.typicode.com/users') | |
/* | |
Now remember what I said about an API's response? | |
It usually spits out JSON which is close to a regular object. | |
But not quite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://jsonplaceholder.typicode.com/users') | |
.then(API_Response => API_Response.json()) | |
.then(data => console.log(data)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Mario", | |
"age": 22, | |
"brother": "Luigi", | |
"food": "Mushroom" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Person = { | |
name: "Mario", | |
age: "22", | |
brother: "Luigi", | |
food: "Mushrooms" | |
} |