Skip to content

Instantly share code, notes, and snippets.

@jwillmer
jwillmer / README.md
Created October 13, 2024 19:19
Motion Extraction with JavaScript (Interactive Demo)

Motion Extraction with JavaScript (Interactive Demo)

This code demonstrates a simple motion extraction technique using JavaScript and HTML5's video and canvas elements. It captures frames from either a live camera feed or an uploaded video, inverts the colors, and blends consecutive frames to isolate motion changes. Users can adjust resolution, delay between snapshots, and toggle a freeze-frame mode to lock the reference frame, allowing for a clear view of motion in relation to the frozen frame.

Inspired by CodeParade's video, this project highlights the power of real-time video processing using basic browser technologies.

@amirrajan
amirrajan / 00_demo.md
Last active November 10, 2024 14:28
DragonRuby Game Toolkit - Ramp Collisions and Jumping
ramp-collision.mp4
class Game
  attr :args

  def defaults
    args.state.terrain ||= [
      { x: 0,  y: 0, w: 128, h: 128, left_perc: 0, right_perc: 0.5 },
      { x: 128,  y: 64, w: 128, h: 128, left_perc: 0, right_perc: 1.0 },
@ThioJoe
ThioJoe / CombineTextFiles.ps1
Created September 9, 2024 17:48
PowerShell Script to combine files in a directory into a single text file
param(
[string]$FolderPath,
[string]$Extension = "txt",
[ValidateSet("name", "date", "name-reverse", "date-reverse")]
[string]$Sort = "name",
[switch]$Recursive
)
Write-Host "------------------------------------------------------------------------------------------------"
Write-Host ""
@ThioJoe
ThioJoe / Windows_XML_String_Resolver.ps1
Last active August 25, 2024 04:30
Takes an XML file that contains windows embedded DLL string references and outputs a new version with the resolved actual string values.
# Windows XML String Resolver
# Author: ThioJoe
#
# Purpose: This script takes an XML file that contains string references (e.g., "@shell32.dll,-1234")
# and resolves them to their actual string values. It's particularly useful for working with
# Windows resource files or any XML that uses similar string reference formats.
#
# How to Use:
# 1. Open PowerShell and navigate to the path containing this script using the 'cd' command.
# 2. Run the following command to allow running scripts for the current session:
@amirrajan
amirrajan / readme.md
Last active November 10, 2024 14:28
xplat UI considerations for games

Things to consider when building a cross-platform game:

  1. Minimum button sizes for touch displays and small screen (eg steamdeck, mobile, nintendo switch hand held mode) is about 60 pixels. Anything smaller will fail lotcheck (Apple, Android, Nintendo).
  2. Visual feedback of UI interactions (Android, Apple -> they'll reject a feature/showcase of your game if you don't have this).
  3. Safe area/layout considerations. Avoid things like notches and app switch "chin". If you're making a game that can render edge to edge/without letter boxing, test at an aspect ratio of 21:12 (1680x960). Your safe are should be centered with an aspect ratio of 16:9 (placement of UI controls should always be in the safe area or they may be inaccesible because of notches and beveled edges).
  4. Button input detection with keyboard, touch, and gamepad. Navigation using keyboard, gamepad, mouse.
  5. Anything below 22px font size is pretty much unreadable on small screens (mobile, Steam Deck, Switch Lite).
  6. Text fields is a world of p
@amirrajan
amirrajan / readme.md
Last active November 10, 2024 14:29
Minimal Emacs configuration for Windows and Mac (Vim bindings and leader key)

Here is a minimal setup that works on Windows and Mac (yes I use Emacs on Windows and it works well).

;; using an editor you are comfortable with
;; create c:/Users/USERNAME/AppData/Roaming/.emacs.d/init.el
;; and paste these contents in there:

;; NOTE: depending on how you start up emacs, your home directory may
;;       be different than the one above. Your initialization file 
;;       needs to be saved at ~/.emacs.d/init.el (however that is mapped
@ThioJoe
ThioJoe / Get_All_Shell_Folder_Shortcuts.ps1
Last active December 28, 2024 09:48
Fetches all shell folders from Windows Registry and creates a shortcut to each, while attempting to determine the proper name and icon. Also outputs CSV file with results.
# NOTE - THIS SCRIPT IS NOW OBSOLETE - SEE MY OTHER REPO FOR A MUCH MORE COMPREHENSIVE TOOL: https://github.com/ThioJoe/Windows-Super-God-Mode
# Get All Shell Folder Shortcuts Script (Updated 8/10/2024)
# Original source: https://gist.github.com/ThioJoe/16eac0ea7d586c4edba41b454b58b225
# This PowerShell script is designed to find and create shortcuts for all special shell folders in Windows.
# These folders can be identified through their unique Class Identifiers (CLSIDs) or by their names.
# The script also generates CSV files listing these folders and associated tasks/links.
# How to Use:
# 1. Open PowerShell and navigate to the path containing this script using the 'cd' command.
@adamz01h
adamz01h / Process_folder.bat
Created April 21, 2024 02:07
Process a folder of Windows Media Playlists to export the list to folders with files.
@echo off
setlocal
:: Check if a folder path was provided as an argument
if "%~1"=="" (
echo No folder path was provided.
pause
exit /b
)
using System;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Runtime.InteropServices;
namespace Utils
{
public unsafe class MemoryMappedFileSpanWrapper : IDisposable
{
private readonly MemoryMappedFileAccess _access;

Tuning Windows 10 for Slow Machines

Windows 10 on slow netbook

This guide is for those who dares to install Windows 10 on slow netbooks (1GB of RAM).
Though Windows update program is over, you still may use old Windows product keys from license stickers to install Windows 10 on old machines.

UPD Jan 2019
This article is quite old, some instructions may be obsolete.