Skip to content

Instantly share code, notes, and snippets.

View lorisleiva's full-sized avatar

Loris Leiva lorisleiva

View GitHub Profile
@lorisleiva
lorisleiva / workflow.yaml
Last active September 18, 2024 11:24
🐳 GitHub Actions using Laravel Docker
name: My Workflow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
container:
image: lorisleiva/laravel-docker:7.4
steps:
- uses: actions/checkout@v2
@kieranajp
kieranajp / gimmesecret.sh
Last active June 10, 2020 17:25
An easy way to look at multiple data items in a Kubernetes secret.
#!/usr/bin/env bash
function usage {
echo "An easy way to look at multiple data items in a Kubernetes secret."
echo " Usage: $(basename $0) <secret> <data ...>"
exit 1
}
if [[ $# -eq 0 ]] ; then
usage
@GuyARoss
GuyARoss / main.js
Created August 9, 2020 08:22
stripe noise thing
import {_ as e, L as t} from "./index-4deec983.js";
import {a as n, C as i} from "./Controller-26bd1e9e.js";
import {S as s} from "./ScrollObserver-d0732a2c.js";
import {F as o} from "./index-bee741e4.js";
class r {
constructor(e, t, n, i=!1) {
const s = this
, o = -1 !== document.location.search.toLowerCase().indexOf("debug=webgl");
s.canvas = e,
s.gl = s.canvas.getContext("webgl", {
@sindresorhus
sindresorhus / esm-package.md
Last active June 4, 2025 00:56
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.
@lorisleiva
lorisleiva / pipeline.js
Last active February 23, 2023 17:28
Laravel-like pipelines in JavaScript and TypeScript
export function pipeline(initialValue, pipes, then) {
then = then ?? ((t) => t);
const pipelineCallback = pipes
.slice()
.reverse()
.reduce((next, pipe) => (passable) => pipe(passable, next), then);
return pipelineCallback(initialValue);
}