Skip to content

Instantly share code, notes, and snippets.

View selfagency's full-sized avatar
👾
beep boop

daniel sieradski selfagency

👾
beep boop
View GitHub Profile
@dopry
dopry / jest-mochawesome.js
Last active April 13, 2023 11:25
jest-mochawesome-reporter
// based on https://gist.github.com/Prophet32j/05a2ceda3743b9fd93e98e56a9227309
const fs = require('fs');
const uuid = require('uuid-v4');
const buildMargeInput = (testResults) => {
let elapsed = buildElapsedTime(testResults.testResults);
let testSuites = testResults.testResults.map(createSuite);
var input = {};
input.stats = {
suites: testResults.numTotalTestSuites,
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 14, 2025 01:40
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@djfdyuruiry
djfdyuruiry / README.md
Last active October 8, 2024 04:54
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@tomhicks
tomhicks / plink-plonk.js
Last active May 12, 2025 16:01
Listen to your web pages
@irazasyed
irazasyed / 1-dnsmasq-dnscrypt-proxy-setup.md
Last active May 10, 2025 08:13
How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

Using Laravel Valet for localhost development, So it installs dnsmasq with it. dnsmasq runs on port 53, The default DNS port. So we setup dnscrypt-proxy on port 5300 with the default config files in this gist.

dnscrypt-proxy Installation

brew install dnscrypt-proxy
@sbooth
sbooth / cloudflared
Last active April 15, 2022 18:30
dnsmasq with dnscrypt-proxy + cloudflared
# /etc/logrotate.d/cloudflared
/var/log/cloudflared/cloudflared.log {
rotate 7
daily
compress
missingok
notifempty
}
@shortjared
shortjared / list.txt
Last active April 11, 2025 14:12
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@jorgebucaran
jorgebucaran / index.html
Last active February 11, 2025 19:31
Getting started with Hyperapp
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module">
import { h, text, app } from "https://unpkg.com/hyperapp"
app({
init: () => 0,
view: state =>
h("main", {}, [
@Prophet32j
Prophet32j / jest-mocha-awesome.js
Last active March 15, 2022 17:47
Jest test output to mocha awesome converter
const marge = require('mochawesome-report-generator');
const fs = require('fs');
const path = require('path');
const uuid = require('uuid-v4');
module.exports = (testResults) => {
const margeInput = buildMargeInput(testResults);
marge.create(margeInput)
.then(function() {