You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🏳️🌈
Building fabulous software.
Jesse Phillips
JamesPhillipsUK
🏳️🌈
Building fabulous software.
Jesse Phillips. PhD Student. Full-stack developer. BDFL @BlogDraw.
I write code, sometimes it works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's my implementation of a BubbleSort algorithm in Python.
I've also taken the opportunity to update my C and PHP BubbleSort Gist from a few years ago.
This was written using Python 3.8.10.
Here's my implementation of a SelectionSort algorithm in C and Python.
It's fairly verbose and easy to read, but could probably do with a cleanup at some point.
The C version was written using GCC 9.3.0, and the Python version was written using Python 3.8.10.
Bresenham's Line Drawing Algorithm implemented in C and ncurses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whilst working on BlogDraw-Updater earlier this week, I created a nifty little system for filesystem traversal in PHP which I thought I'd share with you all because it might be useful. At the very least, it could save a couple of people some time writing something like this out themselves.
It uses depth-first traversal to locate every file in a filesystem, implemented through a recursive function (traverse). "traverse" takes a filepath (either relative, or absolute) to a directory and locates all files and directories within it. It also locates all files and directories in those directories, and so on until it's mapped out the entire filesystem.
Conventions
I've chosen to demonstrate a couple of unusual conventions here, namely:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've had this code lying around for a while now, and I only really use it on one website, because most people that need it have software that can do it for them. I thought other people may find it more useful than I do. So, feel free to use it.
The Code
accessibility.html, this contains the two buttons I use for increased accessibility. It also calls jQuery's CDN (but you can use locally hosted jQuery if you want), and it calls the accessibility.js script.
accessibility.js, this contains a jQuery event handler for each button, containing an anonymous function to handle the button's intended operation.