Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375/
DOCKER_BUILDKIT: 1
build:
stage: build
services:
- name: docker:dind
command: ["dockerd", "--host=tcp://0.0.0.0:2375"]
@pLavrenov
pLavrenov / forge.sh
Created July 29, 2020 23:29
Laravel Forge Setup Script (July 2020) - NGINX + MySQL
# Replace!
# [!server!] (the forge server instance)
# [!sudo_password!] (random password for sudo)
# [!db_password!] (random password for database user)
# [!user.name!] (git user name)
# [!user.email!] (git user email)
# [!server_ip!] (git user email)
#
# REQUIRES:
@amfg
amfg / random.js
Created February 7, 2016 13:30
Generate random unicode string
random = function(length) {
var array = new Uint16Array(length);
window.crypto.getRandomValues(array);
var str = '';
for (var i = 0; i < array.length; i++) {
str += String.fromCharCode(array[i]);
};
return str;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Colorable Grid</title>
<style>
#grid-container {
margin: 0 0;
padding: 0 0;
@bilson
bilson / install-rtl-sdr-ubuntu.sh
Last active May 2, 2024 22:34
Install script for rtl-sdr for ubuntu
#!/bin/bash
cd ~
sudo apt-get update
sudo apt-get install curl git cmake libusb-1.0-0.dev build-essential
cat <<EOF >no-rtl.conf
blacklist dvb_core
blacklist dvb_usb_rtl28xxu
@BertsLifee
BertsLifee / index.html
Created May 2, 2024 22:32 — forked from rssowlreader/index.html
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
</head>
<body>
@sjvnnings
sjvnnings / better_jumping_character_example.gd
Last active May 2, 2024 22:32
An easy to work with jump in Godot
extends KinematicBody2D
export var move_speed = 200.0
var velocity := Vector2.ZERO
export var jump_height : float
export var jump_time_to_peak : float
export var jump_time_to_descent : float
@rmi1974
rmi1974 / defrag_ext4_filesystem.md
Last active May 2, 2024 22:30
How to optimize / defrag ext4 filesystem #ext4 #commandlinefu

How to optimize / defrag ext4 filesystem

Make sure the target filesystem is sane

Open up the terminal and run:

sudo fsck.ext4 -y -f -v /dev/<disk/partition>
@sindresorhus
sindresorhus / esm-package.md
Last active May 2, 2024 22:22
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.