Skip to content

Instantly share code, notes, and snippets.

@nyango
nyango / file0.txt
Created September 28, 2014 02:33
URLの画像やページが存在するかシェル上で確認 ref: http://qiita.com/jamejammy/items/6875f80bf85d92dddef8
curl -v http://qiita.com/jamejammy/items/671a14ae2834c045fe27 2>&1 1>/dev/null | awk '{if($2~"HTTP") print}'
@nyango
nyango / ttfインストール(Ubuntu)
Last active April 8, 2019 01:03
シェル上で🍣🍣(Unicode絵文字)を表示させる ref: https://qiita.com/nyango/items/671a14ae2834c045fe27
mkdir ~/.fonts && cd ~/.fonts
wget http://users.teilar.gr/~g1951d/Symbola.zip
unzip Symbola.zip && rm Symbola.zip
@nyango
nyango / file0.txt
Last active August 29, 2015 14:06
あと何日でXXX(linux dateコマンド) ref: http://qiita.com/jamejammy/items/a7643b3a60a2facf3250
$ echo クリスマスまであと$(echo "`date -d$'12/25' +%j`-`date +%j`" |bc | tr -d '\n')日
@nyango
nyango / DIR_COLORS
Last active February 22, 2016 16:31
シェル上の文字列に色をつける(ピクセル画像も作る)(ANSI color code) ref: http://qiita.com/nyango/items/15de9e9ebfd43b695439
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
@nyango
nyango / hoge_reminder.sh
Last active August 29, 2015 14:06
締め切り通知マシン:/etc/profileとかに書き足して使うとGood
#!/bin/bash
cat /etc/hoge_schedule | while read line
do
a=($line)
rest_days=$(echo "`date -d${a[1]} +%j`-`date +%j`" |bc | tr -d '\n')
[ $rest_days -lt 0 ] && rest_days=$(expr $rest_days + 365)
if [ $rest_days -lt 100 ]; then
if [ $rest_days -gt 20 ]; then
echo ""${a[0]}"まであと"$rest_days"日"
@nyango
nyango / pixel_converter.py
Last active August 29, 2015 14:06
A easy script which converts a char-array to a pixel art on shell(ANSI color code).
#!/usr/bin/python
# coding: utf-8
import sys
argvs = sys.argv
f = open(argvs[1])
line = f.readline()
@nyango
nyango / twi_image_loader
Created January 6, 2014 13:16
Twitterアカウントの画像をぶっこ抜くシェルスクリプト(要インストール:wget, egrep, xargs, awk)
wget -q -O - https://twitter.com/accountname/media | egrep "https\S\/\/\S+jpg\"" | awk -F"\"" '{print $2}' | xargs wget -i
@nyango
nyango / README
Created December 1, 2013 11:32
three.jsで描くローレンツアトラクタ
Lorenz system in javascript with three.js
練習がてらローレンツアトラクタをthree.jsを用いて書いてみた
@nyango
nyango / README
Created December 1, 2013 11:31
一次元オートマトンの全パターン(遷移あり)
ruleは
1,2,...,16
16,
32,
:
, ... ...,255
と並んでます。
@nyango
nyango / jsdoit.css
Created November 21, 2013 08:39
2013-10-20 4th
.clear { clear:both; }
* {
margin:0;padding:0;font-size:1em;line-height:1.5;font-weight:normal;color:#333;
}
html, body {background:#3b3b3b;}
a { text-decoration:underline;color:#40b0eb; }
a:hover { text-decoration:none;color:#3384d6; }
.inner {
width:800px;