Skip to content

Instantly share code, notes, and snippets.

View kosh04's full-sized avatar
🎧

KOBAYASHI Shigeru kosh04

🎧
View GitHub Profile
@kosh04
kosh04 / listup-el.sh
Last active December 30, 2023 15:08
init.el読書会のリクエスト用ストック(気が向いたら追加する)
#!/bin/sh
set -eu
# 指定したディレクトリ以下の elisp 行数を数えるスクリプト
usage="Usage: $0 DIRECTORY [IGNORE_PATTERN]"
DIR=${1?$usage}
IGNORE_PATTERN=${2-}
if [ -n "$IGNORE_PATTERN" ]; then
@kosh04
kosh04 / .gitignore
Last active November 5, 2023 03:12
Chrome Cookies Decrypter
cookie.txt
@kosh04
kosh04 / attach-console.c
Last active May 2, 2022 14:49
WinMainなプログラムでもコンソール出力がしたい
// attach-console.c
// Usage1: > cl attach-console.c & attach-console.exe
// Usage2: $ gcc attach-console.c && ./a.exe
#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
@kosh04
kosh04 / urlencode.sh
Created December 15, 2010 02:45
いろいろな言語でURLエンコード
#!/bin/bash
# 標準入力を URL エンコードする
# NOTE: urldecode は urlencode のシンボリックリンクとする
urlencode() {
# echo -n ${1-`cat`} | od -t x1 -A n | tr " " % | tr -d "\n"
# perl -pe 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg'
python -c 'import sys, urllib; print urllib.quote(sys.stdin.read()),'
# php -r 'echo urlencode(file_get_contents("php://stdin"))."\n";'
}
#!/bin/sh
curl -s http://www.jp.freebsd.org/www.FreeBSD.org/layout/images/beastie.png | pngtopnm | ppmtopgm | pgmtopbm | pbmtoascii -2x4
..
.d&9&'
.o$6H&' o\.
.+S$kM' ?&Rb.
_+S}R&H? `\&9Hb.
+Z$&&&H&D?.o/p1&S6H&&D#>\\ !k&HHH,
|Z$Z&&16&FFR/&&Sk6kMS&9H&HM&b\ H&&&HM:
@kosh04
kosh04 / html5-video.asciidoc
Last active July 30, 2021 11:55
Markdown(gfm)で動画ファイルを再生してみたかった

audio tag

Your browser does not support the audio tag.

video tag

@kosh04
kosh04 / curl_writefunction.c
Created August 1, 2011 18:46
[cURL]コールバック関数を利用してURLの内容をバッファに溜め込む
/* $ gcc -Wall -g [-DDEBUG] curl_writefunction.c -lcurl */
/* $ ./a.out [URL] */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#define BUFFER_MAX 0x10000
size_t write_length = 0;
@kosh04
kosh04 / emacs.mk
Last active March 26, 2020 08:03
Simple makefile for build Emacs
# Build Emacs Recipe
usage = Usage: make -f $(notdir $(MAKEFILE_LIST)) [EMACS=${EMACS}] [PREFIX=${PREFIX}]
PREFIX?=${HOME}/.local
EMACS?=emacs-26.3
EMACS_ARCHIVE=${EMACS}.tar.xz
EMACS_ARCHIVE_URL=http://ftpmirror.gnu.org/emacs/${EMACS_ARCHIVE}
@kosh04
kosh04 / miss-ueno.ini
Created July 23, 2019 04:34
「上野さんは不器用」全12話チャプター
;FFMETADATA1
title=上野さんは不器用
[CHAPTER]
TIMEBASE=1/1000
START=0
END=686200
title=第1話 実験その1「ロッカくん」/実験その2「クマタンダー2号」
[CHAPTER]
@kosh04
kosh04 / wol.lsp
Created July 13, 2019 17:25
Wake on LAN
#!/usr/bin/env newlisp
;; Wake-on-LAN
(define (usage)
(println "Usage: wol.lsp <IP address> <MAC address>"))
;; Convert MAC address to List format.
;; e.g."EE:EE:EE:00:00:01" to (0xEE 0xEE 0xEE 0x00 0x00 0x01)
(define (mac2list mac)
;; XX-XX-XX-XX-XX-XX