Skip to content

Instantly share code, notes, and snippets.

View napthink's full-sized avatar
💭
I may be slow to respond.

napthink napthink

💭
I may be slow to respond.
View GitHub Profile
@napthink
napthink / index.html
Created November 1, 2020 06:40
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
@napthink
napthink / tweetdeck.css
Created August 22, 2020 14:39
stylebot css code for tweetdeck.twitter.com
.column, .stream-item {
background: #000000;
}
.column:nth-child(1) {
width: 500px;
}
.js-stream-item-content {
padding: 5px;
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
from urllib.parse import urljoin
# すでに訪れたページのリスト
visitedPages = set()
@napthink
napthink / Debian_setup.md
Last active January 14, 2018 06:02
Debian のインストール後にやること

Debian のインストール後にすること

sudo を使えるようにする

$ su -
# visudo

以下を追記

user_name ALL=(ALL:ALL) ALL
@napthink
napthink / .vimrc
Last active December 23, 2018 16:49
minimal .vimrc
set encoding=utf-8
set fileencodings=iso-2022-jp,iso-2022-jp-2,utf-8,euc-jp,sjis
set backspace=indent,eol,start
set writebackup
set noswapfile
syntax off
set nonu
set nowrap
set noautoindent
set undodir=~/.vim/undodir
#!/usr/bin/env python
# ファイルを指定文字列に連番を付加したファイル名で置換する
import sys
import os
usage = "Usage %s [FILES] [PREFIX]" %(sys.argv[0])
if (len(sys.argv) == 1):
print(usage)
sys.exit()
@napthink
napthink / mdprev.sh
Last active March 29, 2017 17:52
markdown を html に変換してプレビューするシェルスクリプト
#!/bin/bash
# convert markdown to html and preview the output
usage="usage: $0 [FILE]"
if [ $# = 0 ]; then
echo "$usage" 1>&2
exit 0
fi
source_filename=$(basename $1)
@napthink
napthink / date.ml
Last active January 22, 2017 13:14
Ocaml 練習
(*
* 日付の妥当性チェックとか曜日計算とか
*)
(* うるう年か調べる *)
let isUru y=
if (y mod 4) = 0 then
not(y mod 100 = 0 && not(y mod 400 = 0))
else false;;
@napthink
napthink / list.sh
Created January 22, 2017 12:38
リストの練習
#!/bin/bash
# 2 通りのリスト記法
list1=(
hello
hoge
foo
bar
)
echo "--list1"
@napthink
napthink / compile_c.sh
Last active January 22, 2017 13:17
Cのプログラムを手軽にコンパイル&実行するシェルスクリプト
#!/bin/bash
# 実行ファイルの出力先ディレクトリ
out_dir=~/bin
compiler=gcc
usage="usage: $0 [FILE] [ARGUMENTS]"
if [ $# = 0 ]; then
echo "$usage" >&2