kubectl apply -f dashboard-admin-user.yaml
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
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
| // from the doc or node being parsed | |
| const namespaceResolver = doc.createNSResolver(doc) | |
| // from XML you control | |
| const namespaceResolverDoc = new DOMParser().parseFromString( | |
| `<TEI xmlns="http://www.tei-c.org/ns/1.0"/>`, | |
| 'application/xml' | |
| ) |
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 promise = promisify(execFile)('foo', { | |
| encoding: 'buffer', // remove this to get the output as a string | |
| }) | |
| promise.child.stdin.write(input) | |
| promise.child.stdin.end() | |
| const { stdout: output } = await promise |
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 { JSDOM } = require('jsdom') | |
| const { compact, expand, frame } = require('jsonld') | |
| const url = 'https://www.bbc.co.uk/schedules/p00fzl6p/2020/06/14' | |
| // fetch and parse HTML | |
| const { window: { document } } = await JSDOM.fromURL(url) | |
| // select the script elements containing JSON-LD | |
| const elements = document.querySelectorAll('script[type="application/ld+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
| const items = await Item.aggregate([ | |
| { | |
| $project: { | |
| body: 0, | |
| }, | |
| }, | |
| { | |
| $lookup: { | |
| from: 'users', | |
| localField: 'uid', |
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 config = { iceServers: [ { url: 'stun:stun.l.google.com:19302' } ] } | |
| const [localConnection, remoteConnection] = [new RTCPeerConnection(config), new RTCPeerConnection(config)] | |
| const handleIceCandidate = connection => event => event.candidate && connection.addIceCandidate(new RTCIceCandidate(event.candidate)) | |
| localConnection.onicecandidate = handleIceCandidate(remoteConnection) | |
| remoteConnection.onicecandidate = handleIceCandidate(localConnection) | |
| const [localVideo, remoteVideo] = [document.createElement('video'), document.createElement('video')] |
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
| export INKSCAPE=/Applications/Inkscape.app/Contents/MacOS/inkscape | |
| # ${INKSCAPE} --help | |
| for i in *.emf; do "${INKSCAPE}" --without-gui --export-file="${i}.png" --export-dpi=72 "${i}"; done |
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 axios = require('axios') | |
| const qs = require('qs') | |
| const fs = require('fs-extra') | |
| const thisYear = (new Date).getFullYear() | |
| const fetch = async () => { | |
| const years = [] | |
| for (let year = 1992; year <= thisYear; year++) { |
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
| # Install `now` | |
| yarn global add now | |
| # Install `jo` | |
| brew install jo | |
| # Create a new folder for the project | |
| mkdir now-php-example && cd $_ | |
| # Create now.json |