Skip to content

Instantly share code, notes, and snippets.

View eparadis's full-sized avatar
💭
getting things done

Ed Paradis eparadis

💭
getting things done
View GitHub Profile
var lm = {
buildDefaultAccumulator: function() {
return new lm.Accumulator(0);
},
version: '0.1'
};
lm.Accumulator = function(initial) {
this.value = initial;
@scally
scally / please_dont_use_di.js
Last active April 25, 2020 00:49
Please don't use dependency injection frameworks in modern Typescript/Javascript
/*
If you are using dependency injection in Typescript/Javascript under the pretense that
you are doing anything other than overengineering and making your life and your team's life
harder, please read this.
*/
// The code below doesn't care what `logger` is, only that it exports `log`!
// This creates a test seam / interface behind which you can replace it with ANYTHING!
// You only care that the thing being exported has a `log` function!
import { log } from './logger'
@mtvee
mtvee / punyforth.cpp
Last active July 26, 2020 15:37
A puny forth in c++ for no good reason
/*
* PunyForth
*
* Copyright 2020(c) mtvee
* All rights reserved.
*
* MIT License
*
* 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
@ScienceElectronicsFun
ScienceElectronicsFun / Mod_LaMeresCPU_WebFPGA.v
Created September 12, 2021 16:02
Verilog CPU for WebFPGA
// @MAP_IO port_out_00[0] 06
// @MAP_IO port_out_00[1] 07
// @MAP_IO port_out_00[2] 08
// @MAP_IO port_out_00[3] 09
// @MAP_IO port_out_00[4] 10
// @MAP_IO port_out_00[5] 11
// @MAP_IO port_out_00[6] 12
// @MAP_IO port_out_00[7] 14
// @MAP_IO reset 18
@eparadis
eparadis / meeting_countdown.sh
Created October 18, 2021 19:23
a script that writes to a text file that you can use in OBS for an on-screen meeting timer
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "Usage: ./meeting_countdown.sh NUM_MINS"
exit 1
fi
MINS=$1
OUTFILE=~/src/obs/timer_out.txt
MESSAGE="time remaining in this meeting: "
@tijs
tijs / Ubuntu-on-mac-mini.md
Created January 1, 2014 16:43
Installing Ubuntu on my Mac Mini (2009). Dual boot installation of Mac OS X Mavericks and Ubuntu 13.10
  1. Install rEFIt: http://refit.sourceforge.net/doc/c1s1_install.html

  2. Create a new FAT/DOS partition for the linux install (dual boot setup)

  3. Download the linux ISO, in this case: http://www.ubuntu.com/download/

  4. Convert the iso to a bootable img format:

    cd ~/Downloads hdiutil convert -format UDRW -o ubuntu-13.10-desktop-amd64.img ubuntu-13.10-desktop-amd64.iso

  5. Partition your USB stick as 'Free space' using Disk Uility

  6. Find the name of your USB 'disk' with diskutil:

@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
@Konamiman
Konamiman / SDCC_Interfacing_with_assembler_code.md
Last active February 1, 2024 03:22
[SDCC] Interfacing with Z80 assembler code

SDCC - Interfacing with Z80 assembler code

The basics

When writing code to be compiled with SDCC targetting Z80, assembler code fragments can be inserted in the C functions by enclosing them between the __asm and __endasm; tags:

void DoNotDisturb()
{
  __asm

di

@ttscoff
ttscoff / appinfo.md
Last active March 4, 2024 12:00
appinfo: A quick ruby script for Mac that returns some information for a specified Mac app in Terminal. Includes icon display if using imgcat or chafa are available.

appinfo

A script for getting details of installed Mac apps. Like Get Info but faster and cooler.

Save the script below as appinfo somewhere in your path. Make it executable with chmod a+x appinfo. Then just run appinfo APPNAME to get info on any installed app.

@geerlingguy
geerlingguy / pi-cpu-stress.sh
Last active March 28, 2024 15:20
Raspberry Pi CPU temperature and throttling test script
#!/bin/bash
# Raspberry Pi stress CPU temperature measurement script.
#
# Download this script (e.g. with wget) and give it execute permissions (chmod +x).
# Then run it with ./pi-cpu-stress.sh
#
# NOTE: In recent years, I've switched to using s-tui. See:
# https://github.com/amanusk/s-tui?tab=readme-ov-file#options
# Variables.