Skip to content

Instantly share code, notes, and snippets.

@s-shin
s-shin / simple_audio_player_by_p5_js.html
Last active September 9, 2022 01:08
Simple Audio Player by p5.js.
<html>
<head>
<meta charset="utf-8">
<title>Simple Audio Player by p5.js</title>
<style>
body { margin: 0; }
body > .tp-dfwv { width: 290px; }
body > .tp-rotv.tp-rotv-expanded .tp-rotv_c { overflow: auto; }
</style>
</head>
// MIT License
//------------------------------------------------------------------------------
// Readers
//------------------------------------------------------------------------------
export interface Cursor {
line: number;
column: number;
}
javascript:{ const sha = document.querySelector(".commit-tease-sha"); if (sha) { location.href = location.href.replace(/blob\/[^/]+/, `blob/${sha.textContent.trim()}`); } }
#!/bin/bash
set -eu
: ${ITUNES_MEDIA_DIR:="${HOME}/Music/iTunes/iTunes Media"}
: ${DST_MUSIC_DIR:=/storage/0000-0000/Music}
usage() {
cat <<EOT
Usage: $0 [-x]
@s-shin
s-shin / archive_itunes_albums.sh
Last active August 6, 2018 18:55
Archive albums to specified directory in iTunes media directory.
#!/bin/bash
set -eu
: ${ITUNES_MEDIA_DIR:="${HOME}/Music/iTunes/iTunes Media"}
usage() {
cat <<EOT
Usage: $0 [options] [<re>]
Options:
@s-shin
s-shin / latest-commit.js
Created January 15, 2018 05:26
Bookmarklet for changing the location of per code view page in github to the one of latest commit.
{
const sha = document.querySelector(".commit-tease-sha");
if (sha) {
location.href = location.href.replace(/blob\/[^/]+/, `blob/${sha.textContent.trim()}`);
}
}
@s-shin
s-shin / io
Last active December 22, 2017 15:15
#!/bin/bash
set -eu
: ${IO_RUNNING_FILE:=.io_running}
: ${IO_STDIN_FILE:=.io_stdin}
: ${IO_STDOUT_FILE:=.io_stdout}
io.help() {
cat <<EOT
Usage: io <command> [<args>]
@s-shin
s-shin / amazon-wishlist-discount-checker.js
Last active November 28, 2017 14:02
Copy, paste and run in dev console.
(function() {
const THRESHOLD = 400;
function isEndOfList() {
return document.querySelector("#endOfListMarker") !== null;
}
function scroll(top) {
document.scrollingElement.scrollTop = top;
package main
import (
"bufio"
"bytes"
"compress/gzip"
"encoding/binary"
"fmt"
"io"
"log"
package main
import (
"bufio"
"bytes"
"encoding/binary"
"fmt"
"io"
"log"
"net"