- Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
- pathname - The "file/directory" portion of the URL, like
invoices/123
- search - The stuff after
?
in a URL like/assignments?showGrades=1
. - query - A parsed version of search, usually an object but not a standard browser feature.
- hash - The
#
portion of the URL. This is not available to servers inrequest.url
so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things. - state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
- pathname - The "file/directory" portion of the URL, like
This file contains 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
/** | |
@class BroadcastChannel | |
A simple BroadcastChannel polyfill that works with all major browsers. | |
Please refer to the official MDN documentation of the Broadcast Channel API. | |
@see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API">Broadcast Channel API on MDN</a> | |
@author Alessandro Piana | |
@version 1.0.0 | |
*/ | |
/* |
This file contains 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
/** | |
* Parse private or public key in PKCS#1 or PKCS#8 format | |
* No 3rd-party library required | |
*/ | |
import java.nio.charset.Charset; | |
import java.security.KeyFactory; | |
import java.security.PrivateKey; | |
import java.security.PublicKey; | |
import java.security.spec.PKCS8EncodedKeySpec; |
This file contains 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
#policy: read,test | |
#pppoe-interface | |
:local pppoe "pppoe-out1" | |
#dnspod-token | |
:local token "uid,api-toekn" | |
#dnspod-domain | |
:local domain "example.com" |
This file contains 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
#!/bin/sh | |
# file: node_modules/realm/scripts/download-realm.sh | |
# cwd: node_modules/realm | |
cd "$(dirname $0)/.." | |
source ./dependencies.list | |
VENDOR_DIR="vendor" | |
LOCKFILE_NAME="download-realm.lock" | |
NEW_CORE_SERVER_FOLDER="core/v${REALM_CORE_VERSION}" |
This file contains 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
// remove directory recursively | |
const { promisify } = require('util'); | |
const $fsys = require('fs'); | |
const $path = require('path'); | |
const fstat = promisify($fsys.stat); | |
const lsdir = promisify($fsys.readdir); | |
const mkdir = promisify($fsys.mkdir); | |
const rmdir = promisify($fsys.rmdir); | |
const unlink = promisify($fsys.unlink); |
This file contains 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://www.textnow.com | |
// https://www.google.com/voice/?setup=1#setup/ | |
// node >= 8 | |
// usage: node script.js "curl ..." | |
const https = require('https'); | |
const http = require('http'); | |
const zlib = require('zlib'); | |
const { URL } = require('url'); |
I hereby claim:
- I am shenjunru on github.
- I am shenjunru (https://keybase.io/shenjunru) on keybase.
- I have a public key whose fingerprint is E3F1 148D 82A1 007E 9266 FDAD 5B97 70CD 0A18 0E3B
To claim this, I am signing this object:
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
This file contains 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
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
NewerOlder