This file contains 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
function draw_arrow(context, x, y, angle, magnitude) { | |
const head_length = 10; | |
const dx = Math.cos(angle) * magnitude; | |
const dy = Math.sin(angle) * magnitude; | |
const end_x = x + dx; | |
const end_y = y + dy; | |
context.beginPath(); | |
context.moveTo(x, y); | |
context.lineTo(end_x, end_y); | |
context.lineTo(end_x - head_length * Math.cos(angle - Math.PI / 6), end_y - head_length * Math.sin(angle - Math.PI / 6)); |
This file contains 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
gb() { | |
git checkout main | |
git pull | |
git branch "$1" | |
git checkout "$1" | |
} |
This file contains 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
const hrefs = [...document.querySelectorAll('.albumThumb a[href*="playlist.view?id="]')].map((e) => e.href); | |
let lastPlaylistId = -1; | |
hrefs.forEach((e) => { | |
const id = parseInt(new URL(e)?.searchParams?.get('id')); | |
if (id > lastPlaylistId) { | |
lastPlaylistId = id; | |
} | |
}); | |
for (let i = 1; i <= lastPlaylistId; i++) { | |
let index = i; |
This file contains 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
// 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', | |
}, |
This file contains 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
<script type="module" defer> | |
import devtools from '/devtools-detect.js'; | |
const consoleInfoAnimation = () => { | |
// console.info animation here | |
}; | |
const handleDevtoolsChange = (e) => { | |
if (e.detail.isOpen) { | |
consoleInfoAnimation(); |
This file contains 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
// 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) { |
This file contains 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
interface YearDropdownPluginConfig { | |
text: string; | |
theme: string; | |
date: Date; | |
yearStart: number; | |
yearEnd: number; | |
} | |
const yearDropdownPlugin = function ({ | |
text = "", |
This file contains 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
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); |
This file contains 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
import os, glob, eyed3 | |
os.chdir("./") | |
for file in glob.glob("*.mp3"): | |
filename = os.path.basename(file) | |
if " - " in filename: | |
artist, track = filename.split(' - ') | |
if "".__eq__(track): | |
track = artist | |
artist = "" |
This file contains 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
{ | |
"Chill funk": [ | |
"Snakehips - On & On", | |
"GRiZ - Wonder Why", | |
"Joe Cocker - Feelin' Alright.mp3", | |
"Daft Punk - Solar Sailer (Pretty Lights Remix)", | |
"Pretty Lights - A Million Tomorrows", | |
"Atu - Wanna Luv U", | |
"Pretty Lights - Pretty Lights vs. Led Zeppelin", | |
"Pretty Lights - Around The Block feat. Talib Kweli", |
NewerOlder