Skip to content

Instantly share code, notes, and snippets.

View dylanferguson's full-sized avatar
🤠

dylanferguson

🤠
View GitHub Profile
@dylanferguson
dylanferguson / UUIDv6.sql
Created March 25, 2025 11:17 — forked from fabiolimace/UUIDv6.sql
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
fontforge -lang=ff -c 'Open($1); SelectWorthOutputting(); foreach Export("svg"); endloop;' font.ttf
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
@use "sass:meta";
@use "sass:list";
@use "sass:map";
@mixin breakpoint($args...) {
$min-breakpoints: (
xs: 320px,
sm: 600px,
md: 900px,
lg: 1200px,
font-family: 'Mplus 1p', 'Hiragino Sans', 'Hiragino Kaku Gothic Pro', '游ゴシック' , '游ゴシック体' , YuGothic , 'Yu Gothic', 'MS ゴシック' , 'MS Gothic', sans-serif;
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
@dylanferguson
dylanferguson / debugging.js
Created August 3, 2018 11:10
A Better Way™ to log
// https://twitter.com/brian_d_vaughn/status/1025045172818563072
//red
console.log(
`%c label %c ...message... %c !!! `,
"background-color: #f00; color: #fff; padding: 2px; font-weight: bold;",
"background-color: #fcc; padding: 2px;",
"background-color: #f00; color: #fff; padding: 2px; font-weight: bold;",
);
@dylanferguson
dylanferguson / progress.10s.sh
Last active July 23, 2018 11:18 — forked from aurorabbit/progress.10s.sh
Bitbar timely progress bar
#!/bin/sh
# add this to your bitbar directory
# don't forget to chmod +x
# width and characters for the progress bars
# feel free to configure these
width=30
# fill_char="▄"
# empty_char=" "
from ics import Calendar, Event
from datetime import datetime, timedelta
from pytz import timezone
import csv
import re
if __name__ == "__main__":
with open('timetable.csv', 'r', encoding='utf-8') as csvfile:
reader = csv.DictReader(csvfile)
time_zone = timezone('Australia/Melbourne')
#!/bin/bash
cmprss() {
name=$(echo "$1" | cut -d'.' -f1)_out
ext=$(echo "$1" | cut -d'.' -f2)
if [[ -f "$1" ]]; then
case "$1" in
*.jpg) convert "$1" -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB "${name}.jpg";;
*.png) convert "$1" -strip "${name}.png";;