Skip to content

Instantly share code, notes, and snippets.

View drjamesj's full-sized avatar

James Joffe drjamesj

  • Melbourne, Australia
  • 00:15 (UTC +10:00)
View GitHub Profile
@drjamesj
drjamesj / wordsearch.php
Last active May 23, 2021 11:53
Wordsearch Generator
<?php
class WordsearchGenerator
{
private array $matrix;
private array $letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
private int $dimension = 14;
private array $leftMargin = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
// 'Circular' wordsearch grid
@drjamesj
drjamesj / image_downloader.php
Created May 23, 2021 11:56
Image Downloader
<?php
require 'vendor/autoload.php';
use Goutte\Client;
class ImageDownloader
{
private $images = [];
@drjamesj
drjamesj / +page.svelte
Last active March 9, 2024 19:06
Use vite-imagetools in SvelteKit
<script>
import MyFancyImg from '$lib/images/large_image.png?w=400&format=webp';
</script>
<img
alt="Here is my optimised image in next gen format"
width="400"
height="400"
src={MyFancyImg}
/>