Skip to content

Instantly share code, notes, and snippets.

View remy's full-sized avatar
🐹
Always hacking

Remy Sharp remy

🐹
Always hacking
View GitHub Profile
@montasaurus
montasaurus / llmc.sh
Last active August 21, 2024 07:47
AI Shell Command Generator
llmc() {
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.'
local temp_file=$(mktemp)
local capturing=true
local command_buffer=""
local first_line=true
local cleaned_up=false # Flag to indicate whether cleanup has been run
cleanup() {
# Only run cleanup if it hasn't been done yet
@khalidx
khalidx / node-typescript-esm.md
Last active November 14, 2024 08:26
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@awfulwoman
awfulwoman / gist:19871fc80fb89d8ea2f6769d2f54e20f
Last active October 27, 2021 14:27
Complain to the BBC about that transphobic hit piece
Complain at https://www.bbc.co.uk/contact/complaints/make-a-complaint/#/Complaint
Title: 'We're being pressured into sex by some trans women'
URL: https://www.bbc.co.uk/news/uk-england-57853385.amp
Author: Caroline Lowbridge
Date of publication: 26 Oct 2021
*OBVIOUSLY DO NOT JUST COPY AND PASTE THIS - USE IT TO WRITE YOUR OWN COMPLAINT.*
@ped7g
ped7g / flipULA.asm
Last active February 3, 2021 20:40
ZX Spectrum Next - ULA double buffering example
DEVICE ZXSPECTRUMNEXT
ORG $8000 ; this example does map Bank5/Bank7 ULA to $4000 (to use "pixelad" easily)
mainLoop:
call FlipULABuffers ; flip the buffer screen to visible screen and flip buffer
call drawDot
jr mainLoop
FlipULABuffers: ; Flip ULA/Alt ULA screen (double buffer ULA screen)
; ret ; uncomment to see effect of non-double-buffered running (blinking dots)
ld a,(ULABank) ; Get screen to display this frame
@LucentW
LucentW / template32k.asm
Last active January 9, 2023 12:44
Template for GBC repro carts "load/write SRAM from/to flash" routines (32KB variant)
; 32K routines by LucentW#6667 / https://t.me/LucentW / https://github.com/LucentW
; big credits to BennVenn for the base template for 8K savestates,
; part of the routines used for this, the explanatory video
; and the effort into collecting the infos for these patches
; BennVenn's video: https://www.youtube.com/watch?v=l2bx-udTN84
; Things we need to know to patch our ROM.
; Use the Joey's debug log, Lesserkuma's FlashGBX flash prober or read the datasheet
@ped7g
ped7g / ECHO.asm
Created May 24, 2020 20:02
sjasmplus version of ZX Spectrum Next dot command "ECHO"
OUTPUT "ECHO"
ORG 8192
Start: ex de,hl
ld a,d
or e
ret z ; DE == 0, no pointer to arguments
Print: ld a,(de)
or a
ret z ; zero byte end of command line
cp 13
@davidblackuk
davidblackuk / space.z80
Created March 18, 2018 14:39
How to convert a zx spectrum, x, y coordinate to a screen address via a lookup table. See http://www.overtakenbyevents.com/lets-talk-about-the-zx-specrum-screen-layout-part-three/
; IN - B = pixel row (0..191)
; IN - C = character column (0..31)
; OUT - HL = screen address
; OUT - DE = trash
coords_to_address:
ld h, 0
ld l, b ; hl = row
add hl, hl ; hl = row number * 2
ld de, screen_map ; de = screen map
add hl, de ; de = screen_map + (row * 2)
@adactio
adactio / minimal-serviceworker.js
Last active August 18, 2023 09:15
An attempt at a minimal viable service worker.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
// HTML files: try the network first, then the cache.
// Other files: try the cache first, then the network.
// Both: cache a fresh version if possible.
// (beware: the cache will grow and grow; there's no cleanup)
const cacheName = 'files';
@marktani
marktani / subscriptions.html
Created December 15, 2017 15:48
Replace __PROJECT_ID__ and __TOKEN__ and adjust QUERY
<html>
<head>
<title>Websockets Test</title>
</head>
<body>
<script>
const socket = new WebSocket(
'wss://subscriptions.graph.cool/v1/__PROJECT_ID__','graphql-ws'
)
socket.addEventListener('open', event => {
@urlsangel
urlsangel / .dockerfile
Last active October 30, 2017 21:48
Run python with docker-compose
FROM python:3.6.2
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
ENV PYTHONUNBUFFERED 1