Skip to content

Instantly share code, notes, and snippets.

View izawa's full-sized avatar
🏕️
BRB

いざわゆきみつ (Yukimitsu Izawa) izawa

🏕️
BRB
View GitHub Profile
@izawa
izawa / kintai.ico
Created July 16, 2021 09:34
kintai.ico
// 利用者の環境によって変更すること
#define SSID_NAME "YOUR_SSID"
#define SSID_PASSWORD "YOUR_PASSWORD"
#define SLACK_HOOK_URL "/services/XXXXXXXXXXX/XXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"
// slackの仕様変更の際に要変更
#define SLACK_HOST "hooks.slack.com"
const char* ca = "-----BEGIN CERTIFICATE-----\n" \
@izawa
izawa / xrain.py
Created August 20, 2018 01:49
xband radar image (Ishikawa Pref.) generator for iTerm2
from datetime import datetime
from datetime import timedelta
import iterm2_tools
import urllib.request
import io
from PIL import Image
###################
## http utility function
@izawa
izawa / ikadraw.rb
Created August 18, 2017 07:37
Splatoon2 picture drawing application (requires raspberrypi + UFB)
# coding: utf-8
require 'rmagick'
require 'optparse'
require 'pi_piper'
include PiPiper
class Gpio
DELAY = 0.04
require 'i2c'
class LCD
def initialize(addr, path)
@addr = addr
begin
@dev = I2C.create(path)
rescue => e
puts e.to_s
exit 1
% git clone https://github.com/keiko713/rails-todo.git
% cd rails-todo
% bundle install --without production
% foreman run bundle exec rake db:migrate
% foreman start
localhost:5000 で確認する。
@izawa
izawa / untco.el
Created February 20, 2014 09:11
t.co url -> regular url replacer function
;; t.co -> regular url replacer
(defun untco ()
(interactive)
(let ((tco (buffer-substring (region-beginning) (region-end))))
(setq resolv (replace-regexp-in-string "\n+$" "" (shell-command-to-string (format "curl -s -I %s |awk \'$1~/[lL]ocation/{print $2}\'" tco))))
(if (> (length resolv) 0)
(progn
(kill-region (region-beginning) (region-end))
(insert resolv)))))
@izawa
izawa / checkauth.rb
Created April 1, 2013 07:28
basic authentication cheker over HTTPs
#! env ruby
require 'net/https'
require 'optparse'
Server="www.example.com"
Port=443
CAfile="/usr/local/share/ca-bundle.crt"
def usage
puts("Usage: checkauth.rb -i <datafile>")
@izawa
izawa / kpcal.rb
Created July 17, 2012 02:19
Home brew Kpcal formula
require 'formula'
class Kpcal < Formula
url 'http://www.tamaru.kuee.kyoto-u.ac.jp/~tsuchiya/misc/kpcal/kpcal-2.0-20040518.tar.gz'
md5 'fe8f98207c91745d3b824296dcab3fec'
def install
system "make"
bin.install 'kpcal'
end
@izawa
izawa / filladapt-wchar.patch
Created June 8, 2012 10:47
wchar patch for fillapapt.el
*** /Users/izawa/Desktop/filladapt.el 2012-06-07 17:08:35.000000000 +0900
--- /Users/izawa/.emacs.d/filladapt/filladapt.el 2012-06-08 19:37:01.000000000 +0900
***************
*** 796,807 ****
(space-list '(?\ ?\t))
(space ?\ )
(lim (length string)))
! (setq string (copy-sequence string))
(while (< i lim)
(if (not (memq (aref string i) space-list))
@izawa
izawa / emacs.rb
Created March 21, 2012 10:04
Brew formula for Emacs-23.4 with Japanese patches, derived from brew's official.
require 'formula'
class Emacs < Formula
homepage 'http://www.gnu.org/software/emacs/'
url 'http://ftpmirror.gnu.org/emacs/emacs-23.4.tar.bz2'
mirror 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.4.tar.bz2'
md5 '070c68ad8e3c31fb3cb2414feaf5e6f0'
fails_with_llvm "Duplicate symbol errors while linking.", :build => 2334