Skip to content

Instantly share code, notes, and snippets.

View hertzg's full-sized avatar
🏠
Working from home

George Hertz hertzg

🏠
Working from home
View GitHub Profile
@hertzg
hertzg / cloud-init.yaml
Created May 11, 2024 13:45 — forked from syntaqx/cloud-init.yaml
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@hertzg
hertzg / build.yml
Created September 29, 2023 12:10 — forked from aslak01/build.yml
private tap github actions publish on tag
name: build
on:
push:
branches: master
jobs:
tap:
runs-on: macos-latest
steps:
@hertzg
hertzg / mikrotik-ping-notification.txt
Created March 28, 2023 23:41 — forked from sitchi/mikrotik-ping-notification
MikroTik check ping status and send SMS
# RouterOS script for pinging a list of addresses (sending SMS from UBILL API https://ubill.ge)
# Example
# Insert script: System > Scheduler > + Name=ubill-ping; interval=00:01:00;
# insert IP for monitoring: IP > Firewall > Address Lists > + Name=ubill-ping; Address=1.1.1.1; Comment=Router-Tbilisi;
:local ip;
:local disabled;
:local com;
/ip firewall address-list
@hertzg
hertzg / 00-cloud-config.yml
Created March 13, 2021 22:59 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@hertzg
hertzg / footgun.md
Created August 13, 2019 13:20 — forked from Rich-Harris/footgun.md
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@hertzg
hertzg / save.py
Created March 30, 2019 15:32 — forked from mickael9/save.py
Factorio map metadata parser
from zipfile import ZipFile
from struct import Struct
class Deserializer:
u16 = Struct('<H')
u32 = Struct('<I')
def __init__(self, stream):
self.stream = stream
@hertzg
hertzg / debug.js
Created November 9, 2017 12:52 — forked from ptomato/debug.js
GJS debugger
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const System = imports.system;
let _breakpoints = 0;
function _getCurrentStack() {
try {
throw new Error();
} catch (e) {
@hertzg
hertzg / persistence.xml
Last active August 29, 2015 14:26 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
@hertzg
hertzg / .mpdconf
Last active August 29, 2015 14:19 — forked from robcowie/.mpdconf
## ~/.mdpconf
port "6600"
music_directory "~/Music/"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/state"
#bind_to_address "~/.mpd/mpd.sock"
@hertzg
hertzg / fun.coffee
Last active August 29, 2015 14:15 — forked from fson/fun.coffee
# factorial
$ = (_) ->
__ = _
--__ && _ = _ * $ __
_
# each
$$ = (_, __) ->