Skip to content

Instantly share code, notes, and snippets.

View tacone's full-sized avatar
💭
¯\_(ツ)_/¯

tacone

💭
¯\_(ツ)_/¯
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 22, 2024 09: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.
@acoyfellow
acoyfellow / sapper-to-svelte-kit-conversion.md
Last active August 12, 2021 11:28
My personal Sapper to Svelte-Kit Cheat Sheet (this is not-official, and pre launch, don't use this unless you like fighting dragons and breaking changes)
  • change how you access goto -- from: import { goto } from "@sapper/app"; -- to: import { goto } from "$app/navigation";

  • change how you access sessions --from:

@tacone
tacone / utils.sh
Last active January 23, 2024 15:22
bash logging function
#!/bin/bash
ignore () { true }
warning () { echo "$@" }
error () { ERR=$?; echo "$@"; return $ERR }
# --- Usage
#
# set -e;
#
@pyrou
pyrou / docker-compose.yml
Last active May 22, 2024 00:48
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
@kinlane
kinlane / shopify-openapi.json
Created August 12, 2018 05:30
shopify openapi
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "Shopify API",
"description": "TODO: Add Description"
},
"host": "DefaultParameterValue:DefaultParameterValue@DefaultParameterValue.myshopify.com",
"basePath": "/",
"schemes": [
@alkrauss48
alkrauss48 / Dockerfile
Last active November 10, 2022 16:24
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app
@zofe
zofe / envoy.php
Last active December 1, 2015 14:24
@servers(['web' => 'nomeutente@professionisti.it', 'local'=>'localhost'])
<?php
$repo = 'public_html/stage/';
?>
@task('commit', ['on'=>'local'])
git add .
git commit -m "auto"
git push origin master
@jatubio
jatubio / .php_cs
Created June 13, 2015 11:51
Config file to pass PHP-CS-Fixer with Laravel 5.1 custom and PSR-2 styles coding
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
@enil
enil / wait
Created June 5, 2015 17:00
Wait for user to press any key in ZSH
#!/bin/zsh
echo 'Press any key to continue...'; read -k1 -s
@zofe
zofe / routes.php
Last active August 29, 2015 14:07
Internal router for rapyd-laravel that match "uri" and/or "query string", it can run before Laravel to Fire widget events
<?php namespace Zofe\Rapyd;
/**
* Class Router
* the rapyd router, works "before" laravel router to check uri/query string
* it set widgets status / actions.
*
* @package Zofe\Rapyd
*
* @method public static get($uri=null, $query=null, Array $route)