Skip to content

Instantly share code, notes, and snippets.

@doop
doop / mac-bytejam.md
Last active December 28, 2024 13:58
How to byte-jam on a mac

How to do a TIC-80 byte-jam on an ARM mac

Byte jams are a fun demoscene event where there's usually music from a DJ and several participants who use the TIC-80 fantasy console to code up a graphics effect from scratch within an hour. I usually watch the Field-FX stream on Monday evenings, and occasionally take part; there's an archive of the graphical effects people have made in these sessions, here.

A rather neat part of this is that TIC-80 has been modified to allow its programs to access the FFT of a sound stream, so that you can make your programs respond to the music in real-time. However, this can require a bit of setup on a mac.

In this document I will describe how to set up the audio software, plus byte jam client and TIC-80 itself, to allow participation in a byte jam.

Initial downloads

@danvy
danvy / WSL2-Net-Fix.ps1
Created September 5, 2020 21:04
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
# Restart the Host Network Service
Restart-Service -Force -Name hns
@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active December 28, 2024 13:48 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@kenmori
kenmori / TypeScriptPractice.md
Last active December 28, 2024 13:47
TypeScript 練習問題集
@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@gmolveau
gmolveau / firefox_dark_background.md
Last active December 28, 2024 13:51
Firefox dark background / theme for new tab and loading screen

Firefox Dark Background

  • How to change the background on Firefox to a dark one on new tab / loading screen ?

Procedure

  • Type about:config in the URL bar
  • Search toolkit.legacyUserProfileCustomizations.stylesheets and double-click the field to set it to true
  • Type about:support in the URL bar
  • Look for Profile folder field and click on the open button next to it.
@joosep-wm
joosep-wm / !entry.md
Created December 28, 2024 13:42
Example entry - alien crawler website

Title of your application

Demo video: youtube.com....

Prompt

Act as software engineer and help me build one file application. Here's what I want to achieve.

It is a web crawler, which searches for alien conspiracy theories, stores the URL of the theory. Give the theory a headline and also short summary. Then continues to other links from that page. It must 
remember visited sites, so it wouldn't go into circles.
@ateska
ateska / streaming_tar.py
Last active December 28, 2024 13:44
Streaming asynchronous non-blocking tar using Python and asyncio
import os.path
import aiohttp.web
async def get_tar(request):
'''
AIOHTTP server handler for GET request that wants to download files from a `directory` using TAR.
'''
directory = <specify the directory>
response = aiohttp.web.StreamResponse(
@ardaorkin
ardaorkin / delete-all-bookmarks.js
Last active December 28, 2024 13:44
Recursive script to delete all Chrome bookmarks via the browser's UI.
/**
* Script to recursively delete all bookmarks using the Chrome Bookmarks Manager UI.
* This script continues to run until no more bookmarks are available.
*
* Instructions:
* 1. Open Chrome Bookmarks Manager:
* - Go to `chrome://bookmarks` in your Chrome browser.
*
* 2. Open Developer Tools:
* - Right-click anywhere on the page and select "Inspect" OR
[
{
"Title": "Avatar",
"Year": "2009",
"Rated": "PG-13",
"Released": "18 Dec 2009",
"Runtime": "162 min",
"Genre": "Action, Adventure, Fantasy",
"Director": "James Cameron",
"Writer": "James Cameron",