Skip to content

Instantly share code, notes, and snippets.

View daftspaniel's full-sized avatar

Davy Mitchell daftspaniel

  • Scotland
View GitHub Profile
@daftspaniel
daftspaniel / windowcontrol.ahk
Created December 30, 2022 09:48
AutoHotkey 2.0 Window Controls
; HOTKEYS - Ctrl + F1 etc
^F1::CenterActiveWindow()
^F2::FocusActiveMinOthers()
^F3::NarrowActiveWindow()
CenterActiveWindow()
{
windowWidth := A_ScreenWidth * 0.9 ; desired width
windowHeight := A_ScreenHeight * 0.92 ; desired height
windowName := WinGetTitle("A")
@daftspaniel
daftspaniel / hexdslwallpaper.ps1
Created November 10, 2021 11:45
Download and set the wallpaper from hexdsl.co.uk
# Change to image1 if you fancy a different wallpaper.
Invoke-WebRequest -Uri https://hexdsl.co.uk/image2.jpg -OutFile wall.jpg
# Pinched from Stackoverflow :-)
$setwallpapersrc = @"
using System.Runtime.InteropServices;
public class Wallpaper
{
public const int SetDesktopWallpaper = 20;
@daftspaniel
daftspaniel / simpleclock.py
Last active February 13, 2021 20:16
Super simple Tkinter clock. v0.1
# Super simple Tkinter clock. v0.1
# Public domain.
# 2021 Feb 13 - daftspaniel - www.casterbridge.xyz
import tkinter as tk
import time
class App():
def __init__(self):
self.root = tk.Tk()
@daftspaniel
daftspaniel / mp3tovideo.sh
Created March 31, 2020 06:42
FFMPEG to convert MP3 and JPG to video with wave form.
ffmpeg -i audio.mp3 -i logo.jpg -filter_complex "[0:a]showwaves=s=1280x720:mode=line,colorkey=0x000000:0.01:0.1,format=yuva420p[v];[1:v]scale=1280:720[bg];[bg][v]overlay[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy output.mkv
ORG $4E21
PSHS X,Y,U,A,B
LDX #$400
LEAY SCREEN,PCR
DRAW LDU ,Y+
STU ,X+
CMPX #$5FE
BLE DRAW
(function() {
var _currentDirectory = (function () {
var _url;
var lines = new Error().stack.split('\n');
function lookupUrl() {
if (lines.length > 2) {
var match = lines[1].match(/^\s+at (.+):\d+:\d+$/);
// Chrome.
if (match) return match[1];
// Chrome nested eval case.
@daftspaniel
daftspaniel / boxgrid.asm
Created March 11, 2018 15:44
Screen border WIP
* Draw boxes across the screen.
*
ORG $4E21
LDX #$600 ; Screen base address
LDB #$00 ;
BOXROW LDA #$FF ;
STA ,X ;
LDA #$81 ;
@daftspaniel
daftspaniel / rowofboxes.asm
Last active March 5, 2018 22:12
6809 attempt
ORG $4E21
LDX #$600 ; Screen base address
LDB #$00 ;
BOX LDA #$FF ;
STA ,X ;
LDA #$81 ;
STA 32,X ;
STA 64,X ;
STA 96,X ;
STA 128,X ;