Skip to content

Instantly share code, notes, and snippets.

View jawj's full-sized avatar

George MacKerron jawj

View GitHub Profile
@hitorilabs
hitorilabs / WINDOWS11.md
Last active April 24, 2024 14:53 — forked from hungneox/WIN10.MD
Install Windows 11 From A Bootable USB (macos)

Personally, I prefer installing operating systems from a USB stick, so here's a tutorial

TL;DR

If you already have some idea of what's going on:

  1. Download the ISO from Microsoft - https://www.microsoft.com/en-ca/software-download/windows11
  2. Erase USB device and format in MS-DOS/FAT32
diskutil eraseDisk MS-DOS "WINDOWS11" MBR /dev/diskX
@phiresky
phiresky / sql-libs-for-typescript.md
Created June 26, 2020 10:42
SQL libs for typescript

Using SQL databases in a typed language is a pain unless you have great libraries to support you. There's a lot of different libraries for TypeScript, but they all have flaws.

This is complete overview of SQL libraries for TypeScript. If I'm missing a library, please let me know.

Object Relation Mappers (ORMs)

In an ORM you declare the schema completely in the host language (TypeScript). The ORM then completely manages synchronization between your objects / classes and the corresponding database tables.

ORMs always have the same issues: If you have somewhat complex queries, you will get to the limit of the ORM and not be able to represent that query in it without escape hatching. You also lose direct control over how the queries are handled, and thus may get surprising performance issues when the ORM uses dumb SQL queries in the background.

@GrahamCobb
GrahamCobb / Humax HMT format
Last active December 15, 2023 07:35
Humax HDR Recorders file formats
Offset Size Content
------ ----- ---------------------------------- Header Block, Size 0x1004 (4100) bytes ---------------------------------------------
0x0000 2 byte 0x1701 Constant.
0x0000 126 byte All Nulls.Constant
------ ----- ---------------------------------- This next part is rewritten when playback completes/pauses
It seems to contain information about the recording
0x0080 string 254 byte max Recording file path e.g. "/media/sda1/My Video/" (not needed when creating hmt)
0x017F string 256 byte max Recording date-extended file name e.g. "The One Show_21010816_1817"
0x0280 4 byte 0x11223344 Recording start time (Epoch format)
0x0284 4 byte 0x11223344 Recording end time (Epoch format)
@randomsequence
randomsequence / OutlineTextView.m
Created June 11, 2013 07:59
Drawing outlined glyphs with CoreText
//
// OutlineTextView.m
// Outline
//
// Created by Johnnie Walker on 10/06/2013.
//
#import "OutlineTextView.h"
#import <CoreText/CoreText.h>
@kentbrew
kentbrew / node-on-ec2-port-80.md
Last active February 4, 2024 19:14
How I Got Node.js Talking on EC2's Port 80

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
@endolith
endolith / peakdet.m
Last active February 14, 2024 21:27
Peak detection in Python [Eli Billauer]
function [maxtab, mintab]=peakdet(v, delta, x)
%PEAKDET Detect peaks in a vector
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local
% maxima and minima ("peaks") in the vector V.
% MAXTAB and MINTAB consists of two columns. Column 1
% contains indices in V, and column 2 the found values.
%
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices
% in MAXTAB and MINTAB are replaced with the corresponding
% X-values.