Skip to content

Instantly share code, notes, and snippets.

View AWolf81's full-sized avatar

Alexander Wolf AWolf81

View GitHub Profile
@AWolf81
AWolf81 / app.js
Created December 18, 2018 14:23
Basic Express server example
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('An alligator approaches!');
});
app.listen(3000, () => console.log('Gator app listening on port 3000!'));
@AWolf81
AWolf81 / Profile-20190425T231328_ProjectSettingsModal_opening_and_closing_animation.json
Created April 25, 2019 21:17
Chrome profile - Guppy sc-v4 branch - ProjectSettingsModal performance
[{"pid":12100,"tid":22488,"ts":75204026765,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../mojo/public/cpp/system/simple_watcher.cc","src_func":"Notify"},"dur":84,"tdur":83,"tts":78152265},
{"pid":12100,"tid":22488,"ts":75204114424,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../gpu/ipc/client/gpu_channel_host.cc","src_func":"Send"},"dur":35,"tdur":32,"tts":78152624},
{"pid":12100,"tid":22488,"ts":75204114464,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../gpu/ipc/client/gpu_channel_host.cc","src_func":"Send"},"dur":10,"tdur":10,"tts":78152661},
{"pid":12100,"tid":22488,"ts":75204114613,"ph":"X","cat":"ipc,toplevel","name":"ChannelMojo::OnMessageReceived","args":{"class":65535,"line":65520},"dur":6,"tdur":6,"tts":78152716},
{"pid":12100,"tid":22488,"ts":75204114904,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../gpu/ipc/client/gpu_channel_host.cc","src_func":"Send"},"dur":26,
@AWolf81
AWolf81 / test.js
Created May 5, 2019 12:31
BoostNote linting test
import React from 'react'
import ReactDOM from 'react-dom'
// import PropTypes from 'prop-types'
// Note: Remove the next line to test linting warnings
/* eslint-disable */
// Test prefer-const --> rule working with standardx as it respects .eslintrc
export const preferCondtDemo = function () {
let notVariable = 'demo'
return notVariable
// .prettierrc
// (filename in gist just to have a better title in the gist overview page as mentioned [here](https://github.com/isaacs/github/issues/194))
//
// install prettier with
// yarn add prettier pretty-quick husky
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 70
@AWolf81
AWolf81 / example.test.h
Created February 23, 2020 21:37
ucunit example with trace point call counter feature (see Test_CheckTracepointsDemo function)
/*
* File: example.test.h
* Author: Alexander Wolf
* License MIT
* Created on 23. Februar 2020, 11:54
*/
#include "testsuite.h"
#ifndef EXAMPLE_TEST_H
@AWolf81
AWolf81 / run-tests.js
Last active March 6, 2020 07:49
Run Mocha.js tests with html reporter from CLI with JSDOM
var Mocha = require('mocha'),
fs = require('fs'),
path = require('path');
const { JSDOM } = require('jsdom')
const dom = new JSDOM(`<html><body>
<div id="mocha"></div>
</body></html>`);
global.document = dom.window.document;
@AWolf81
AWolf81 / content-script-2.ts
Created January 18, 2021 21:54
Web extension using snowpack & snowpack-plugin-web-ext for content-scripts
// location: src/content-scripts/content-script-2.ts
// just to have an import
export function hello() {
return "Hello World";
}
@AWolf81
AWolf81 / plugin-dotenv.js
Created February 4, 2021 22:21
Snowpack plugin-dotenv with path option
const fs = require('fs');
const path = require('path');
module.exports = function plugin(_, {path:envPath}) {
const NODE_ENV = process.env.NODE_ENV;
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [
NODE_ENV && `.env.${NODE_ENV}.local`,
// Don't include `.env.local` for `test` environment
@AWolf81
AWolf81 / .env
Last active February 6, 2021 15:40
Demo for injecting the version from package.json with Snowpack
SNOWPACK_PUBLIC_SOME_OTHER_ENV=just a test
@AWolf81
AWolf81 / devserver-plugin.js
Created February 7, 2021 13:41
Snippet for accessing dev server Javasript interface from Snowpack plugin
const snowpack = require("snowpack")
const {startServer} = snowpack;
let server;
/*
package.json snippet for starting "snowpack dev"
"scripts": {
"start": "cross-env NODE_ENV=development snowpack build --watch",