Skip to content

Instantly share code, notes, and snippets.

View kotet's full-sized avatar

Kotet kotet

View GitHub Profile
@hmans
hmans / mastodon_bookmarklet.md
Last active December 22, 2022 03:11
Mastodon Follow/Interact Bookmarklet

Mastodon Follow/Interact Bookmarklet

All desktop browsers (I think/hope) support bookmarklets -- bookmarks that contain JavaScript code which is run when you select them. This bookmarklet makes it easier to follow users or interact with toots from other Mastodon instances by passing their URLs back to your home instance, where you can then follow/interact with them normally.

The bookmarklet:

javascript:var host="mastodon.social";if(document.location.hostname==host){alert("Already on your own instance!")}else{document.location=("https://"+host+"/authorize_interaction?uri="+encodeURIComponent(document.location))}
@lan496
lan496 / makefig.sh
Created October 29, 2019 05:30
convert dot file with latex symbol into pdf
#!/bin/bash -eu
if [ $# -ne 1 ]; then
echo "specify dot file"
exit 1
fi
dotfile=$1
tmpfile=$(mktemp)
texfile="${1}.tex"
@takahashim
takahashim / aozora-api.md
Last active March 7, 2021 13:31
青空文庫のAPI化についての資料

青空文庫のAPI化についての資料

勝手にまとめているものです。随時更新中(last update: 2015/05/26)

3行まとめ

  • 現状、公式の「青空文庫API(サーバ)」はなさそう
  • 公式サイトでは作品データのCSVを配布している
  • このCSV等を使った「野良APIサーバ」の試みはあった(今もある)
@keigo-brook
keigo-brook / gist:5d532d0665a8b07bbe0e
Last active December 8, 2016 09:56
ubuntuで画面の動画キャプチャを撮った後、gifして圧縮
必要なソフトをインストール
% sudo aptitude install gtk-recordmydesktop mplayer imagemagick
recordmydesktopを使ってキャプチャを撮る。/home/Videosに保存される。
mplayerを使ってまずはjpegに変換。jpegが大量に出力されるので出力ディレクトリを作っておく
% mplayer -ao null 入力動画ファイル -vo jpeg:outdir=出力ディレクトリ
imagemagickを使ってgifに変換
% convert 出力ディレクトリ/*.jpg 出力ファイル名.gif
@willurd
willurd / web-servers.md
Last active April 15, 2024 09:55
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@repeatedly
repeatedly / d_master.md
Last active June 8, 2023 06:20
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.