Skip to content

Instantly share code, notes, and snippets.

View huntie's full-sized avatar

Alex Hunt huntie

View GitHub Profile
@huntie
huntie / dsa-query-selector.js
Last active January 3, 2022 02:14
A simplified implementation of `document.querySelector()` and `document.querySelectorAll()`, during a workshop on data structures.
/**
* Run a callback over all children of a given element using depth-first
* traversal.
*
* @param {HTMLElement} element
* @param {Function} callback
*/
function iterateDOM(element, callback) {
const nodes = [];
@huntie
huntie / KeyGenerateCommand.php
Last active July 19, 2016 13:13
APP_KEY generation command for Lumen, adapted from Illuminate\Foundation\Console\KeyGenerateCommand
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class KeyGenerateCommand extends Command
{
/**
* The name and signature of the console command.
@huntie
huntie / keybase.md
Last active June 6, 2016 13:05
Keybase GitHub identity

Keybase proof

I hereby claim:

  • I am huntie on github.
  • I am huntie (https://keybase.io/huntie) on keybase.
  • I have a public key whose fingerprint is 144D 5AFF A2FB 93C3 167B 5B0C 7B78 B3A2 DCC8 FF93

To claim this, I am signing this object:

@huntie
huntie / miner.py
Last active November 10, 2015 16:22
Challenge to find permutations of words within a scrambled text file
text = open('scrambled.txt', 'r').read()
words = ['miner', 'willy', 'andre', 'jet', 'set', 'bug', 'byte']
def permute(string):
result = []
if len(string) == 1:
result = [string]
else:
for i, char in enumerate(string):
@huntie
huntie / add-sublime-to-terminal.md
Last active May 31, 2018 11:17
Add Sublime Text 3 as a terminal command in macOS

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

@huntie
huntie / print.css
Created June 12, 2014 12:07
Show link addresses alongside titles in a printed webpage
@media print {
a:after {
/* Display link address for accessibility */
content: ' [' attr(href) '] ';
}
}