Skip to content

Instantly share code, notes, and snippets.

@s-shin
s-shin / oauth2.py
Created June 1, 2012 16:30
This module is a sample of the OAuth2 authentication by Python3
#!/usr/bin/env python3
"""This module is a sample of the OAuth2 authentication by Python3"""
__version__ = "0.1.0"
__author__ = "shin (shin.hateblo.jp)"
__copyright__ = "(C) 2012 shin"
__email__ = "s2pch.luck@gmail.com"
__license__ = "Apache License 2.0"
__status__ = "Prototype"
@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>
@s-shin
s-shin / three.msm.coffee
Last active September 2, 2020 18:07
Micro Scene Manager for Three.js
###
three.msm.js - Micro Scene Manager for Three.js
Version 0.1.0
(C) 2013 Shintaro Seki
MIT License
###
# Usage? Let's read the code below!
@MSM = MSM = {}
@s-shin
s-shin / tcp-gzip.go
Created June 7, 2017 04:51
An example of tcp and gzip in golang.
package main
import (
"compress/gzip"
"io"
"log"
"net"
)
func main() {
// 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 / spigot.js
Created August 16, 2012 08:18
Simple Pi calculation library for JavaScript
/**
* spigot.js
* version 1.1.0
* (C) 2012 shin <s2pch.luck at gmail.com>
* Licensed under the Apache License 2.0
* http://opensource.org/licenses/apache2.0
*
* The Pi calculation is based on the spigot (streaming) algorithm[1].
* This library depends on jsbn[2] (jsbn.js and jsbn2.js),
* one of BigInteger library written by pure JavaScript.
@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()}`);
}
}