Skip to content

Instantly share code, notes, and snippets.

View saml's full-sized avatar

Sam Lee saml

  • New York, NY
View GitHub Profile
# hlsearch on (H) or off (h):
~H
# Last Search Pattern:
~MSle0~/$
# Last Substitute Search Pattern:
~MSle0&$
# Last Substitute String:
$\r
test("Can receive broadcast connection", async (done) => {
jest.setTimeout(500); // timeout quickly if done() isn't called.
let postResult = null;
// Need to set up message handler *before* making POST request.
ws.addEventListener("message", async (event) => {
try {
// When message arrives, we know POST request was sent. So, verify its result.
const resp = await postResult;
expect(resp.status).toBe(200);
$ emulator -accel-check
accel:
0
KVM (version 12) is installed and usable.
accel
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
file /usr/share/doc/gnutls/AUTHORS from install of gnutls-3.6.14-1.fc31.i686 conflicts with file from package gnutls-3.6.13-1.fc31.x86_64
file /usr/share/doc/gnutls/NEWS from install of gnutls-3.6.14-1.fc31.i686 conflicts with file from package gnutls-3.6.13-1.fc31.x86_64
file /usr/share/locale/ms/LC_MESSAGES/gnutls.mo from install of gnutls-3.6.14-1.fc31.i686 conflicts with file from package gnutls-3.6.13-1.fc31.x86_64
file /usr/share/man/man5/cert8.db.5.gz from install of nss-3.53.0-1.fc31.i686 conflicts with file from package nss-3.52.0-2.fc31.x86_64
$ emulator @Pixel_2_API_28
Fontconfig warning: "/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf", line 6: unknown element "reset-dirs"
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
E0616 09:32:44.729029599 5363 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1592314364.728946614","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}
Your emulator is out of date, please update by launching Android Studio:
- Start Android Studio
- Select menu "Tools > Android > SDK Manager"
- Click "SDK Tools" tab
class AuthError extends Error {
constructor(message) {
super(message);
// Error.captureStackTrace(this, AuthError);
}
}
function f(o) {
try {
const [_, token] = o.authorization.split('Bearer ');
// Utilities for express.
/**
* Wraps request handler and calls next() on error.
* @param {Function} reqHandler express request handler. It doesn't have to return Promise.
*/
function asyncWrap(reqHandler) {
async function handlerWrap(req, res, next) {
try {
// reqHandler might not return Promise. So, can't do reqHandler().catch();
FROM mhart/alpine-node:12.2 as builder
# Do crazy stuff
FROM mhart/alpine-node:12.2 as app
WORKDIR /app
RUN apk add --no-cache tini
# Can I use a single COPY?
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
#!/bin/bash
REPOS=(foo bar)
git_up() {
if (( $# > 0 ))
then
repos=$@
else
repos=${REPOS[@]}
async (next) => {
const x = await f1();
if (x) {
return next();
}
f2(() => {
f3();
next();
});
// fails eslint consistent-return