Skip to content

Instantly share code, notes, and snippets.

workin' goodly

Gianni Chiappetta gf3

workin' goodly
View GitHub Profile
gf3 / env2yaml64.rb
Created Sep 10, 2021
Create the `data` part of a kubernetes opaque secret from an ENV file
View env2yaml64.rb
require "base64"
require "dotenv"
require "yaml"
if ARGV.empty?
puts "Usage: #{__FILE__} <env file>"
exit 1
file = ARGV[0]
gf3 / boot options
Created May 27, 2020
Grub boot options (threadripper/nvidia)
View boot options
mce=off blacklist=nouveau modprobe.blacklist=nouveau
gf3 / 81-disable-onboard-audio.rules
Created Apr 7, 2020
Linux on AMD TRX40 (Threadripper) and NVIDIA 2080ti RTX
View 81-disable-onboard-audio.rules
# /etc/udev/rules.d/81-disable-onboard-audio.rules
# Disable onboard Asustek USB audio device
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{idProduct}=="1917", ATTR{authorized}="0"
gf3 /
Created May 29, 2019
error[E0507]: cannot move out of borrowed content
extern crate unidiff;
use unidiff::PatchSet; //
pub struct Printer {
patch_set: PatchSet,
impl Printer {
pub fn new(source: &str) -> Self {
gf3 /
Last active Jan 22, 2019
Neovim config setup
# Install:
# curl -fsL | sh
# Directories
mkdir -p ~/.local/share/nvim/{backup,swap,undo}
# Config
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
gf3 /
Last active Jan 22, 2019
Docker: VPN + DNS Proxy + App

Docker setup

Using the docker-compose.yml below as a template, replace the webapp section with your application.

VPN setup

Follow the setup guide here:

Afterwards we'll want to modify the VPN config so that it points to our local DNS proxy.

gf3 / uuid.ts
Created Feb 20, 2018
Generate a secure RFC4122-compliant v4 UUID
View uuid.ts
* Convert a number or array of integers to a string of padded hex octets.
function asHex(value: number[] | Uint8Array): string {
return Array.from(value).map(i => ('00' + i.toString(16)).slice(-2)).join('');
* Attempt to securely generate random bytes/
gf3 / email-test.js
Last active Dec 21, 2017
Validate and correct misspelled emails using a fuzzy matcher
View email-test.js
/* eslint-env jasmine */
import { validate, suggest } from './email';
describe('email', () => {
describe('validate', () => {
it('should correctly validate correct email addresses', (done) => {
const promises = [
gf3 /
Last active Apr 13, 2021

Keybase proof

I hereby claim:

  • I am gf3 on github.
  • I am gf3 ( on keybase.
  • I have a public key ASBSUcu3p7hJhvRo-yZRFSGw8dpcfC6SjR2A8PQHo84l1go

To claim this, I am signing this object:

gf3 / Spotify.swift
Created Aug 29, 2017
Spotify ScriptingBridge from Swift
View Spotify.swift
import AppKit
import ScriptingBridge
@objc public protocol SBObjectProtocol: NSObjectProtocol {
func get() -> Any!
@objc public protocol SBApplicationProtocol: SBObjectProtocol {
func activate()
var delegate: SBApplicationDelegate! { get set }