Skip to content

Instantly share code, notes, and snippets.

View amacgillivray's full-sized avatar
⚔️
battling the borrow-checker

Andrew MacGillivray amacgillivray

⚔️
battling the borrow-checker
View GitHub Profile
@phpdave
phpdave / .aliases
Last active February 24, 2023 11:06
Files to put in your /home/USER/ directory on IBM i to enable cool things in Bash
# .aliases
# vim:syntax=shexit
# Reload bash aliases
alias reload="source ~/.bash_profile"
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
@mbostock
mbostock / .block
Last active July 8, 2025 14:16
Poisson-Disc II
license: gpl-3.0
@NYKevin
NYKevin / accounting.sql
Last active October 8, 2025 17:35
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
@joshbeckman
joshbeckman / animatedScrollTo.js
Created September 30, 2013 14:51
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@eikes
eikes / getElementsByClassName.polyfill.js
Created April 4, 2012 08:04
Polyfill for getElementsByClassName
// Add a getElementsByClassName function if the browser doesn't have one
// Limitation: only works with one class name
// Copyright: Eike Send http://eike.se/nd
// License: MIT License
if (!document.getElementsByClassName) {
document.getElementsByClassName = function(search) {
var d = document, elements, pattern, i, results = [];
if (d.querySelectorAll) { // IE8
return d.querySelectorAll("." + search);