Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Damien Guard damieng

🏠
Working from home
View GitHub Profile
@damieng
damieng / image-grid.html
Created Mar 24, 2020
Redraw a glyph/image sheet with dividing lines between elements
View image-grid.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<canvas id="myCanvas"></canvas>
<br>
@damieng
damieng / reset-wifi-on-wake.xml
Last active Dec 17, 2019
Reset WiFi adapter on wake
View reset-wifi-on-wake.xml
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2019-12-17T10:49:39.5675591</Date>
<URI>\Wake on WiFi</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="System"&gt;&lt;Select Path="System"&gt;*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter' or @Name='power'] and (EventID=1)]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
@damieng
damieng / zx-font-publish.sh
Last active Aug 15, 2020
ZX Spectrum font publishing
View zx-font-publish.sh
#!/bin/bash
for i in "$@"
do
name="${i%.*}"
zip="${name}.zip"
rm -rf "${zip}"
# Preview creation
echo Creating previews
pw.exe preview "$i" . >> /dev/null
@damieng
damieng / zx-font-convert.sh
Last active Aug 15, 2020
ZX Spectrum font conversion script
View zx-font-convert.sh
#!/bin/bash
fl5reg="HKCU\Software\FontLab\Studio 5\Directories"
for i in "$@"
do
name="${i%.*}"
echo Processing $name
mkdir -p Spectrum
mkdir -p PC
mkdir -p BBC
pw.exe preview "$i" . >> /dev/null
@damieng
damieng / zx-to-ttf.sh
Last active Apr 21, 2019
ZX to TTF font conversion shell script (required psftools modified, PixelWorld and FontLab Studio + scripts)
View zx-to-ttf.sh
#!/bin/bash
fl5reg="HKCU\Software\FontLab\Studio 5\Directories"
for i in "$@"
do
name="${i%.*}"
echo Processing $name
pw preview "$i" . >> /dev/null
psf="${name}.psf"
vfb="${name}.vfb"
zx2psf "$i" "${psf}" --mode=move1 --graphics=none
@damieng
damieng / theghost.asm
Last active Nov 6, 2018
Ghost 48K compatibility for +2/+3 Sinclair ZX Spectrums
View theghost.asm
; Code by Mark Harris, published in Your Sinclair Issue 59 http://live.worldofspectrum.org/infoseek/magazines/your-sinclair/59#20
; Disassembly and comments by Damien Guard.
ORG 28000
; Setup pages to allow 48K ROM to be copied to RAM page 4.
DI
LD A,0x14 ; 48K ROM at 0x0000, RAM page 4 at 0xc000
LD BC,0x7ffd ; 128K paging port
OUT (C),A ; Switch the pages
@damieng
damieng / crystal-quest.unp
Last active Jul 22, 2018
Crystal Quest decompiled PAWS adventure
View crystal-quest.unp
PAW Database : CrystalQuest.z80
Extracted by UNPAWS32 v2.1
General data
------------
Locations 49
Objects 60
@damieng
damieng / jekyll1.unp
Created Jul 22, 2018
Dr. Jekyll & Mr Hide Part 1 decompiled
View jekyll1.unp
PAW Database : JEKYLL.sna
Extracted by UNPAWS32 v2.1
General data
------------
Locations 25
Objects 15
@damieng
damieng / config.yml
Last active Jun 3, 2018
CircleCI config for damieng.com
View config.yml
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.3
working_directory: ~/jekyll
environment:
- JEKYLL_ENV=production
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- JOB_RESULTS_PATH=run-results
@damieng
damieng / algolia-search.html
Last active May 30, 2018
Algolia search from damieng.com
View algolia-search.html
<script src="https://cdn.jsdelivr.net/npm/algoliasearch@3/dist/algoliasearchLite.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/algoliasearch-helper@2.26.0/dist/algoliasearch.helper.min.js"></script>
<script>
let searchForm = document.getElementById('search-form')
let hits = document.getElementById('hits')
let algolia = algoliasearch('{your-site-id}', '{your-search-token}')
let helper = algoliasearchHelper(algolia, '{your-index-name}', { hitsPerPage: 10, maxValuesPerFacet: 1, getRankingInfo: false })
helper.on("result", searchCallback)
function runSearch() {
You can’t perform that action at this time.