Skip to content

Instantly share code, notes, and snippets.

View zgover's full-sized avatar
Hiring for React + Typescript Developer

Zach Gover zgover

Hiring for React + Typescript Developer
View GitHub Profile
@zgover
zgover / localhost-ssl-certificate.md
Created November 19, 2022 10:04 — forked from ethicka/localhost-ssl-certificate.md
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@zgover
zgover / chbrt.m
Created October 7, 2022 09:22 — forked from waydabber/chbrt.m
This should change the brightness level of a single external display connected to an M1 MBP or MBA relative to the current setting using DDC/CI. Reportedly does not work on M1 Mini.
@import Darwin;
@import Foundation;
@import IOKit;
/*******
This should change the brightness level of a single external display connected to an M1 MBP or MBA relative to the current setting using DDC/CI. Reportedly does not work on M1 Mini.
Credits to @tao-j and @alin23
Compile:
@zgover
zgover / dependency-manager.ts
Created August 20, 2022 02:59
JavaScript Dependency Manager for Loading and Destroying Modules Based on it's Dependencies
export enum DependencyStatus {
WAITING = 'waiting',
LOADING = 'loading',
LOADED = 'loaded',
UNLOADING = 'unloading',
}
export type DependencyId = string
export type DependencyStatuses = Record<DependencyId, DependencyStatus>
export type DependenciesById = Record<DependencyId, Dependency>
<?php
require_once __DIR__.'/V8JsNodeModuleLoader_FileAccessInterface.php';
require_once __DIR__.'/V8JsNodeModuleLoader_NormalisePath.php';
/**
* Simple Node.js module loader for use with V8Js PHP extension
*
* This class understands Node.js' node_modules/ directory structure
* and can require modules/files from there.
*
@zgover
zgover / operators.d.ts
Last active November 22, 2023 23:11
[TS String Literal Operators] Types for JS operators including assignment, comparison, arithmetic, bitwise, logical #typescript #javascript #utility #operator #expression
// d8888 d8b 888
// d88888 Y8P 888
// d88P888 888
// d88P 888 .d8888b .d8888b 888 .d88b. 88888b. 88888b.d88b. .d88b. 88888b. 888888
// d88P 888 88K 88K 888 d88P"88b 888 "88b 888 "888 "88b d8P Y8b 888 "88b 888
// d88P 888 "Y8888b. "Y8888b. 888 888 888 888 888 888 888 888 88888888 888 888 888
// d8888888888 X88 X88 888 Y88b 888 888 888 888 888 888 Y8b. 888 888 Y88b.
// d.d88888b.88 88888P' 88888P' 888 "Y88888 88888888 888 888 888 "Y8888 888 888 "Y888
// d88P" "Y88b 888 888
// 888 888 Y8b d88P 888
/*
Adapted from https://github.com/sindresorhus/github-markdown-css
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@zgover
zgover / missing-ts-types.md
Last active February 14, 2023 04:03
[TS Missing Utility Types] Missing utility types for TypeScript #typescript #types #reusable #utility #utility-types

TypeScript utility types missing

Reusable utility types missing from TypeScript core library. Enjoy!

/**
 * The MIT License (MIT)
 *
@zgover
zgover / cloudflare_update.script
Created July 2, 2021 19:55 — forked from asuna/cloudflare_update.script
Automatic script for Mikrotik RouterOS updating record on CloudFlare.
#########################################################################
# ================================================== #
# $ Mikrotik RouterOS update script for CloudFlare $ #
# ================================================== #
# #
# - You need a CloudFlare account & api key (look under settings), #
# a zone and A record in it #
# - All variables in first section are obvious, except CFid, #
# To obtain CFzoneid use following command in any unix shell: #
# curl -X GET "https://api.cloudflare.com/client/v4/zones" -H "X-Auth-Email: YOUR_EMAIL" -H "X-Auth-Key: YOUR_API_KEY" -H "Content-Type: application/json" | python -mjson.tool
@zgover
zgover / GLOSSARY.md
Last active May 6, 2022 20:48
[IT/Design/Software Terms, Acronyms, Phrases and more...] Glossary Reference for Terms, Acronyms, Phrases, Abbreviations, Numeronyms #glossary #list #awesome #awesome-list #definitions #cloud-computing #ist #cis #principles #business

Glossary Reference (Terms + Acronyms + Numeronyms + Abbreviations + Phrases)

Description & Purpose:

Frequent, commonly used, sometimes mentally lost and forgotten; but unlike Mr.Monoply’s monocle—not missing—quick reference glossary for terminology, meaning and definitions for abbreviations, acronyms, numeronyms, phrases and other terms in the following categories for general areas of interest and fields of Study, Theory and Practice (STP) such as Information Technology (IT), Computer Science (CS), Computer Information Systems (CIS)


(BizDev) Sales + Marketing + Business Development|Models|Strategies

@zgover
zgover / clearable-weak-map.md
Last active April 23, 2021 16:57
[JS/TS Clearable WeakMap] JS/TS – Implementing a clearable WeakMap-like class #javascript #weakmap #class #constructor #garbagecollection #memory #references #private #typescript
class ClearableWeakMap<T = unknown, K extends object = object> {
  private _: WeakMap<K,T>;
  constructor(init: Iterable<[K,T]>) {
    this._ = new WeakMap(init)
  }
  clear() {
    this._ = new WeakMap()
    return this
 }