Skip to content

Instantly share code, notes, and snippets.

View knksmith57's full-sized avatar

Kyle Smith knksmith57

View GitHub Profile
curl -sS "https://demo.backstage.io/api/catalog/entities/by-query" \
     --request GET \
     --get \
     --data filter=kind=component \
     --data limit=10 \
| jq --raw-output '
    .items[]
    |[
       (.kind + ":" + .metadata.namespace + "/" + .metadata.name|ascii_downcase),
@knksmith57
knksmith57 / Dockerfile
Last active February 11, 2021 21:06
selenium/standalone-chrome w/ Node.js installed via nvm
FROM selenium/standalone-chrome:latest
ARG NODE_VERSION=lts/dubnium
ENV NODE_VERSION=$NODE_VERSION \
NVM_DIR=/opt/nvm
USER root
RUN mkdir -p $NVM_DIR \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh \
| PROFILE=/dev/null bash \
@knksmith57
knksmith57 / README.md
Last active December 8, 2018 21:43
configure babel to support ESM and async/await (SO #53540716)
$ tree
.
├── README.md
├── babel.config.js
├── lib
├── package.json
└── src
    ├── app.js
 └── lib.js
'use strict'
const express = require('express')
const app = express()
app.get('/', (req, res) => {
res.send('index')
})
app.get('/foo', (req, res) => {
'use strict'
const debug = require('debug')
;[
'bar',
'foo',
'foo:error',
'foo:moduleA',
'foo:error:moduleA',
#!/usr/bin/env bash
set -eo pipefail
##
## extract .netrc creds inspired by https://bugs.launchpad.net/python-jenkins/+bug/941400
##
## usage:
## netrc_credentials example.com # // 'myuser mypassword'
## netrc_credentials example.com username # // 'myuser'
## netrc_credentials example.com password # // 'mypassword'
#!/usr/bin/env bash -e
instance_name="throw-away-$(date +%s)"
region=us-west1-b
ssh_key_dir="$(mktemp -d)"
cleanup() {
echo "removing temp dir: $ssh_key_dir"
rm -rf "$ssh_key_dir"
{
"name": "knksmith57/lnc-identity-call-stack-error",
"description": "example setup for reproducing LnC #235",
"authors": [
{
"name": "Kyle Smith",
"email": "knksmith57@gmail.com"
}
],
"require": {
@knksmith57
knksmith57 / gist:00e6f77456b86299e6d24c9940d29ee4
Created March 30, 2016 18:33
correct atom feed response
❯ curl -i -X GET -H'Accept: application/atom+xml' https://github.com/nodejs/node/releases.atom
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 30 Mar 2016 18:32:14 GMT
Content-Type: application/atom+xml; charset=utf-8
Transfer-Encoding: chunked
Status: 200 OK
Cache-Control: no-cache
Vary: X-PJAX
X-UA-Compatible: IE=Edge,chrome=1
@knksmith57
knksmith57 / gist:f1785e80d6e2f9fa6a4634c8fc98a49b
Created March 30, 2016 18:30
empty nodejs/node release response
❯ curl -i -X GET -H'Accept: application/json' https://api.github.com/repos/nodejs/node/releases
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 30 Mar 2016 18:29:48 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 5
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1459365215