Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊
workin' goodly

Gianni Chiappetta gf3

🍊
workin' goodly
View GitHub Profile
@gf3
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
end
file = ARGV[0]
@gf3
gf3 / gist:328089
Created Mar 10, 2010
iTerm Colours
View gist:328089
Black: 0, 0, 0
Red: 229, 34, 34
Green: 166, 227, 45
Yellow: 252, 149, 30
Blue: 196, 141, 255
Magenta: 250, 37, 115
Cyan: 103, 217, 240
White: 242, 242, 242
@gf3
gf3 / gist:306785
Created Feb 17, 2010
Sexy bash prompt
View gist:306785
Moved to: http://github.com/gf3/dotfiles/blob/master/bash_prompt
@gf3
gf3 / keybase.md
Last active Apr 13, 2021
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am gf3 on github.
  • I am gf3 (https://keybase.io/gf3) on keybase.
  • I have a public key ASBSUcu3p7hJhvRo-yZRFSGw8dpcfC6SjR2A8PQHo84l1go

To claim this, I am signing this object:

@gf3
gf3 / iTunes.swift
Created Aug 29, 2017
iTunes ScriptingBridge from Swift
View iTunes.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 }
@gf3
gf3 / jsonp.js
Created Jun 18, 2009
Simple JSONP in vanilla JS
View jsonp.js
/**
* loadJSONP( url, hollaback [, context] ) -> Null
* - url (String): URL to data resource.
* - hollaback (Function): Function to call when data is successfully loaded,
* it receives one argument: the data.
* - context (Object): Context to invoke the hollaback function in.
*
* Load external data through a JSONP interface.
*
* ### Examples
View linked_list.c
#include <stdio.h>
#include <stdlib.h>
struct node{
void* data;
struct node* next;
};
void set_int_value(struct node* node, int val)
{
@gf3
gf3 / boot options
Created May 27, 2020
Grub boot options (threadripper/nvidia)
View boot options
mce=off blacklist=nouveau modprobe.blacklist=nouveau
@gf3
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
gf3 / ago.js
Created Jun 2, 2011
Super small relative dates
View ago.js
module.exports = (function(){
const MS =
{ seconds: 1000
, minutes: 60 * 1000
, hours: 60 * 60 * 1000
, days: 24 * 60 * 60 * 1000
, weeks: 7 * 24 * 60 * 60 * 1000
, months: 30 * 7 * 24 * 60 * 60 * 1000
, years: 365 * 24 * 60 * 60 * 1000 }