Skip to content

Instantly share code, notes, and snippets.

View Boldewyn's full-sized avatar

Manuel Strehl Boldewyn

View GitHub Profile
@deebloo
deebloo / shadow-element.ts
Last active January 25, 2023 22:04
Small utility for apply html template and construct-able stylesheets to custom elements.
import { shadow, ShadowTemplate, html, css } from './shadow.js';
const template: ShadowTemplate = {
css: css`
:host {
display: contents;
}
`.
html: html`
<slot></slot>
@sindresorhus
sindresorhus / esm-package.md
Last active April 25, 2024 08:14
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@boina-n
boina-n / bash-smtp.sh
Created June 1, 2020 17:58
Send email with bash in in TLS, SSL or in plain text
#!/bin/bash
subject="Subject of my email"
txtmessage="This is the message I want to send"
username='mail@exemple.com'
password='************'
From="mail01@exemple.com"
rcpt='testemail5739230@yopmail.com'
from_name='N BOINA'
rcpt_name='Nicolas Hulot'
@barryosull
barryosull / index.php
Created February 28, 2020 10:32
PHPUnit Code Coverage Report of Web App
<?php
/**
How to run a code coverage report on a web page:
Simply put this code after the vendor require and before the rest of the calling logic.
(Assumes you have PHPUnit installed)
**/
require_once __DIR__ . "/../vendor/autoload.php";
(function () {
var previousInputMode = false;
var inputMode = (function() {
try {
var inputMode = window.sessionStorage.getItem('inputMode');
if (!inputMode) {
return undefined;
}
if (window.ga) {
window.ga('set', 'dimension1', inputMode);
@veltman
veltman / README.md
Last active December 18, 2020 08:51
Centerline label placement

Implementing a variation of Joachim Ungar's curved label placement method described here. The basic process is:

  1. Turn the shape into a polygon of evenly-spaced points.
  2. Generate a Voronoi diagram of those points.
  3. Clip the edges.
  4. Turn the edges into a graph.
  5. Find the "longest shortest path" between any pair of perimeter nodes.
  6. Smooth/simplify that path a bit.
  7. Place text along the smoothed centerline with a <textPath>.
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active March 22, 2024 18:05
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@claytonrcarter
claytonrcarter / README.md
Last active December 18, 2023 15:31
Bash script to check GitLab pipeline status

A super simple bash script to check the status of a GitLab CI pipeline.

$ git push
...
$ git pipeline-status
Status of last pipeline for user/project on gitlab/master:
"pending"
...
$ git pipeline-status
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 25, 2024 03:58 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy