Skip to content

Instantly share code, notes, and snippets.

View ngsctt's full-sized avatar

Nathan ngsctt

View GitHub Profile
@ngsctt
ngsctt / install-exa-macOS.md
Created April 7, 2024 04:33
Steps to install exa on macOS

Install exa on macOS

Steps

  1. Download exa realease archive from Github
  2. Extract and cd into the folder
  3. Copy the executable to /usr/local/bin (optionally sudo):
    cp bin/exa /usr/local/bin
  4. Open the the executable in Finder to remove the GateKeeper quarantine:
class QemuSpice < Formula
desc "Emulator for x86 and PowerPC"
homepage "https://www.qemu.org/"
url "https://download.qemu.org/qemu-7.1.0-rc0.tar.xz"
sha256 "50435f5fb361fbd57b7ec719290fd29f9a6ec96c73f04775a285a514085c7d6a"
license "GPL-2.0-only"
revision 1
head "https://git.qemu.org/git/qemu.git", branch: "master"
bottle do
@ngsctt
ngsctt / userChrome.css
Last active February 26, 2024 07:18
Firefox userChrome
/*
* Open profile folder from about:support
* Place userChrome.css in [profile folder]/chrome/userChrome.css
*/
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Shorten the height of tabs in the tab bar: */
.tabbrowser-tab {
--tab-min-height: 2.8rem !important;
}
--- acconfig.h 2020-02-06 07:09:38.000000000 +1100
+++ acconfig.h 2020-12-28 18:16:28.000000000 +1100
@@ -191,14 +191,14 @@
* If screen is installed with permissions to update /etc/utmp (such
* as if it is installed set-uid root), define UTMPOK.
*/
-#define UTMPOK
+#undef UTMPOK
/* Set LOGINDEFAULT to one (1)
#!/bin/bash
# <bitbar.title>CPU Temperature</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Nathan Scott</bitbar.author>
# <bitbar.author.github>ngsctt</bitbar.author.github>
# <bitbar.desc>This plugin displays the current CPU temperature, using osx-cpu-temp by @lavoiesl</bitbar.desc>
# <bitbar.dependencies>osx-cpu-temp</bitbar.dependencies>
#
# osx-cpu-temp can be downloaded from: https://github.com/lavoiesl/osx-cpu-temp
# One-liner:
@ngsctt
ngsctt / isoTimeStamp.js
Last active July 18, 2020 08:18
JavaScript function to generate an ISO 8601 or RFC 3339 timestamp. MIT licence.
function isoTimeStamp(date, options = {}) {
console.log(options)
let defaults = {
date_time: 'T',
time_offset: ''
}
Object.assign(options, Object.assign(defaults, options));
console.log(options)
const year = date.getFullYear();
const month = String(date.getMonth()).padStart(2, '0');
namespace "version" do
path = 'lib/gem-name/version.rb'
content = File.read(path)
regex = /(VERSION\s*=\s*['"])([0-9.]+)(['"])/
match = content.match(regex)
version = match[2]
vparts = version.split('.')
major = vparts[0] ? Integer(vparts[0]) : 0
minor = vparts[1] ? Integer(vparts[1]) : 0
patch = vparts[2] ? Integer(vparts[2]) : 0
@ngsctt
ngsctt / convert_to_pnpm.md
Last active February 5, 2020 10:22
A simple shell script to convert existing NPM-installed modules to PNPM modules

What

A simple shell script to convert existing NPM-installed modules to PNPM modules

Why

NPM results in a lot of modules being repeatedly installed on the machine, whereas PNPM caches them locally, saving space for pointless duplicates

How

source convert_to_pnpm.sh
@ngsctt
ngsctt / romanise.js
Created January 22, 2020 16:55
JavaScript to convert numbers between 1 and 1,999,999 to roman numerals
function romanise (number, upper=true) {
if (number > 1999999) {
console.warn('WARN: attempted to convert number over 1,999,999 to roman numeral');
return number;
}
const letters = upper ? [
['X', 'V', 'I'],
['C', 'L', 'X'],
['M', 'D', 'C'],
['X̅', 'V̅', 'M'],
@ngsctt
ngsctt / makefile
Created January 22, 2020 09:18
Makefile for simple pug-based templating projects
SHELL := /bin/zsh
DEST ?= print
PORT ?= 8888
WATCH ?= *.pug, *.less
BUILD ?= pug --out $(DEST) [^_]*.pug
includes := $(shell cat _include)
build: copy convert