Skip to content

Instantly share code, notes, and snippets.

View ZachSaucier's full-sized avatar
💻
I have a lot to be humble about.

Zach Saucier ZachSaucier

💻
I have a lot to be humble about.
View GitHub Profile
/* Hide some things I dislike seeing when I read articles */
script {
display: none;
}
[class = "ad"],
[class *= "ads"],
[class ^= "ad-"],
[class ^= "ad_"],
[class *= "-ad-"],
@import 'https://fonts.googleapis.com/css?family=Open+Sans';
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
line-height: 1.75em;
let lastPlaylistId = 55;
for (let i = 1; i <= lastPlaylistId; i++) {
let index = i;
setTimeout(() => window.location = `exportPlaylist.view?id=${i}`, index * 100);
}
@ZachSaucier
ZachSaucier / .zshrc
Created April 2, 2024 19:08
Create and navigate to a new git branch from any other branch
gb() {
git checkout main
git pull
git branch "$1"
git checkout "$1"
}
@ZachSaucier
ZachSaucier / svelte.config.js
Created January 24, 2024 16:54
Multiple sites in one Svelte project in order to share components
// apps/website-1/svelte.config.js
import { createSvelteConfig } from 'config/svelte.js'
import adapter from '@sveltejs/adapter-cloudflare'
export default createSvelteConfig({
adapter: adapter(),
alias: {
$sections: 'src/sections',
},
@ZachSaucier
ZachSaucier / index.html
Created December 4, 2023 23:07
devtools-detect console.info animation setup
<script type="module" defer>
import devtools from '/devtools-detect.js';
const consoleInfoAnimation = () => {
// console.info animation here
};
const handleDevtoolsChange = (e) => {
if (e.detail.isOpen) {
consoleInfoAnimation();
@ZachSaucier
ZachSaucier / doubly-linked-list.ts
Last active May 6, 2023 18:58
A (comprehensive?) implementation of doubly linked lists using TypeScript.
// Note: This doubly linked list implementation is meant to cover most any use
// case of doubly linked lists. You likely don't need all of the functions
// included for your use case.
class DoublyLinkedListNode<T> {
public value: T;
public next?: DoublyLinkedListNode<T>;
public prev?: DoublyLinkedListNode<T>;
constructor(value: T) {
interface YearDropdownPluginConfig {
text: string;
theme: string;
date: Date;
yearStart: number;
yearEnd: number;
}
const yearDropdownPlugin = function ({
text = "",

Windows 10 setup

Step 1) In your .bashrc (you can use something like vim ~/.bashrc to get there), change the following:

This changes the color and removes the host from the bash prompt

if [ "$colo_-prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[0;37m\]\u\[\033[00m\]:\[\033[01;96m\]\w\[\033[00m\]\$ '
else
float dist = 0.5*0.5 - (m.x * m.x + m.y * m.y);
float t = mix( dist / border, 1., max(0., sign(dist - border)) );
gl_FragColor = mix(color0, color1, t);