Skip to content

Instantly share code, notes, and snippets.

2024-02-19 14:58:43 OpenVPN 2.6.8 arm-apple-darwin [SSL (OpenSSL)] [LZO] [PKCS11] [MH/RECVDA] [AEAD]
2024-02-19 14:58:43 library versions: OpenSSL 3.2.0 23 Nov 2023, LZO 2.10
2024-02-19 14:58:43 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2024-02-19 14:58:43 TCP/UDP: Preserving recently used remote address: [AF_INET]35.71.159.181:15790
2024-02-19 14:58:43 UDPv4 link local: (not bound)
2024-02-19 14:58:43 UDPv4 link remote: [AF_INET]35.71.159.181:15790
2024-02-19 14:58:47 Server poll timeout, restarting
2024-02-19 14:58:47 SIGUSR1[soft,server_poll] received, process restarting
2024-02-19 14:58:47 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2024-02-19 14:58:47 TCP/UDP: Preserving recently used remote address: [AF_INET]52.223.29.195:15790
function auth() {
return function (req, res, next) {
var token = headers() || query();
if (!token) {
return next({message: 'access token missing', status: 401});
}
req.mongo.accounts.findOne({accessToken: token}, function (err, account) {
if (err) {
@alexbeletsky
alexbeletsky / game.js
Created September 21, 2012 20:22
Game of Life in 50 lines and 20 specs
// http://en.wikipedia.org/wiki/Conway's_Game_of_Life
var Game = {
init: function (options) {
this.grid = new Grid(options);
},
putCell: function (x, y, state) {
this.grid.putCell(x, y, state);
/* eslint-disable no-console */
/* eslint-disable prefer-arrow-callback */
import expect from 'expect';
import { createTestClient } from 'apollo-server-testing';
import ggl from 'graphql-tag';
import config from '../../../config';
import { createServer } from '../../../src/server';
describe('GET /v2/invoices/{id}.html specs', function () {
describe('de', function () {
before(function () {
// call API and store response..
});
it('should return correct html', function () {
expect(beautify(this.response.payload)).toMatchSnapshot(this);
});
});
export const makeTestTitle = test => {
let next = test;
const title = [];
for (;;) {
if (!next.parent) {
break;
}
title.push(next.title);
expect.extend({
toMatchSnapshot(ctx) {
if (!ctx || !ctx.test) {
throw new Error(
dedent(`missing \`ctx\` parameter for .toMatchSnapshot(),
did you forget to pass \`this\` expect().toMatchSnapshot(this)?`),
);
}
const { test } = ctx;
expect.extend({
toMatchSnapshot() {
// TODO: init testFile, testTitle
const result = toMatchSnapshot(this.actual, testFile, testTitle);
expect.assert(result.pass, !result.pass ? result.report() : '');
return this;
}
import { SnapshotState, toMatchSnapshot } from ‘jest-snapshot’;
export function toMatchSnapshot(actual, testFile, testTitle) {
// Intilize the SnapshotState, it’s responsible for actually matching
 // actual snapshot with expected one and storing results to `__snapshots__` folder
 const snapshotState = new SnapshotState(testFile, {
  updateSnapshot: process.env.SNAPSHOT_UPDATE ? ‘all’ : ‘new’,
 });
// Bind the `toMatchSnapshot` to the object with snapshotState and
expect(response).toMatchSnapshot();