Skip to content

Instantly share code, notes, and snippets.

View honno's full-sized avatar
🛰️

Matthew Barber honno

🛰️
  • Hexegic
  • Southend-on-Sea
  • 08:36 (UTC)
View GitHub Profile
@honno
honno / flashygoodness_extract.py
Created October 18, 2017 08:55
Quick Python script to extract the "archive" music from the flashygoodness site—it isn't available for purchase or download anywhere!
## Music in question https://www.flashygoodness.com/music/gallery/
import requests
import os
import xml.etree.ElementTree as ET
import urllib
import re
folder_name = r'flashygoodness'
@honno
honno / Dice.cs
Created March 17, 2018 15:42
Slot machine-like dice animation
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DiceManager: MonoBehaviour {
/* component reference */
private Image image;
private TravelLightsDisplay hud;
__________________________________________________________________________
// __ ____ __ \\
| ________________________ \ /\ / **>><<***>><<***>><<***>><<***>> |
| / \ \/MM\/ Official Association |
| | .adAMMMAbn. | /\WW/\ HUNTER'S LICENSE |
| | dMMMMMMMMMMA. | _/ _\/_ \_ <<***>><<***>><<***>><<***>><<** |
| | 'HMMMMMMMMMMMl. | |
| | db\MMM^" "^j | NAME(-S): Matthew Roy AGE: 20 |
| | MMY : | SURNAME: Barber GENDER: Male |
| | ,M|`,----. ,---. | NICKNAME: Honno OCCUPATION: Student |
<?php
function para($msg) { echo "<p>$msg</p>"; }
function error($msg) {
$valid = false;
para($msg);
}
$name = trim($_REQUEST["name"]);
<?php
function isPalindrome($string) {
if (strlen($string) <= 1) {
return true;
} elseif (strtolower(substr($string, 0, 1)) == strtolower(substr($string, -1))) {
isPalindrome(substr($string, 1, -1));
} else {
return false;
}
}
<?php
$year = $_REQUEST["year"];
$rating = $_REQUEST["rating"];
$pdo = require 'connectdb.php';
$query = "
SELECT DISTINCT d.id, CONCAT(d.last_name, ', ', d.first_name) AS name
FROM directors d
window.onload = function() {
document.getElementById('find').onclick = findRequest;
};
function findRequest() {
var from = document.getElementById('from').value;
var to = document.getElementById('to').value;
var ajax = new XMLHttpRequest();
ajax.onload = injectDirections;
@honno
honno / description.md
Last active October 24, 2023 14:31
Scraper for Health Lotto gambling game Quick Win

Health Lottery Quick Win Draws Scraper

The Health Lottery in the UK runs an online lottery that runs every 3 minutes called Quick Win, where they employ the services of an online casino games supplier called Gamevy.

And so, scraper.py collates the numbers resulting from each draw to generate a .csv file.

Gamevy has seemingly exposed every past draw of the lottery in one API endpoint that only requires a (publicly available) session token from another endpoint. As of May 2019, that's over 300 000 draws!

I made this as part of a learning exercising to test the "randomness" of this lottery game by way of statistical analysis.

@honno
honno / find-crc32.py
Created July 26, 2019 07:15
Multiprocessing bruteforcing script to find a valid CRC32 checksum in a file which quotes said CRC32 value, i.e. a self-referential CRC32.
#!/usr/bin/python3
import logging
import argparse
import sys
import binascii
import multiprocessing as mp
from time import sleep
SLEEP_TIME = 0.1
@honno
honno / expert-system.lisp
Last active September 28, 2020 15:04
An inference engine for an expert system.
;; Forward & Backward Chaining
;;
;; Use (run *rules *goals) in CLISP to try it out.
;;
;; Written by Matthew Barber <[email protected]> under MIT
;;
;; The MIT License (MIT)
;;
;; Copyright (c) 2019 Matthew Barber
;;