Skip to content

Instantly share code, notes, and snippets.

@ironsand
ironsand / kana-rule.conf
Last active August 5, 2026 01:22 — forked from slmnll/kana-rule.conf
macSKKでAZIKを使うためのローマ字変換ルール
# -*- coding: utf-8 -*-
#
# このファイルは:
# macSKKでAZIKを使うためのローマ字変換ルールです。
# AZIK部分はAquaSKKの`azik_us.rule`をベースにしています。
# https://github.com/codefirst/aquaskk
#
# このファイルの構成:
# - ファイル前半はmacSKKの元々のローマ字変換ルール
# - ファイル後半はAZIK入力用のローマ字変換ルール
@ironsand
ironsand / docker-compose.yml
Created July 17, 2023 11:33
Nginxのリバースプロキシ用 docker-compose.yml
version: "3"
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
@ironsand
ironsand / radiru_scrape.sh
Created April 9, 2020 06:15
【NHK語学講座のらじる★らじる聴き逃しサービスを取得するRubyスクリプト】の一括ダウンロード用シェルスクリプト
#!/bin/bash
#
# NHK語学講座のらじる★らじる聴き逃しサービスを取得するRubyスクリプト
# https://riocampos-tech.hatenablog.com/entry/20200402/radirudegogaku
# の一括ダウンロード用シェルスクリプト。必要ない講座はコメントアウトして
# radirudegogaku0.rb と同じディレクトリに置いて実行してください。
programs=()
programs+=("0677_01") # 基礎英語1
programs+=("0694_01") # 基礎英語2
@ironsand
ironsand / chrome_recipe.rb
Created November 21, 2018 06:34
Itamae Recipe for chrome and chromedriver to Ubuntu 16
package 'gdebi'
execute 'install chrome' do
deb_name = 'google-chrome-stable_current_amd64.deb'
commands = [
'cd /tmp',
"wget https://dl.google.com/linux/direct/#{deb_name}",
"gdebi --n ./#{deb_name}"
]
command commands.join(' && ')
not_if 'command -v google-chrome'
@ironsand
ironsand / dropbox.rb
Last active November 20, 2015 08:11
Dropbox API2でファイルアップロード
require 'uri'
require 'net/http'
require 'openssl'
class DropboxAPI
def initialize(access_token:)
@access_token = access_token
end
def upload(source:, dest:, mode: :overwrite)
uri = URI.parse('https://content.dropboxapi.com')
@ironsand
ironsand / ruby5_mp3_downloader.rb
Created November 20, 2014 14:38
Ruby5 mp3 downloader
require 'rss'
require 'open-uri'
url = 'http://feeds.feedburner.com/Ruby5'
open(url) do |rss|
feed = RSS::Parser.parse(rss)
feed.items.each do |item|
`wget #{item.enclosure.url}`
end
end
@ironsand
ironsand / add_date_to_quick_data
Created October 28, 2014 06:11
quickに日付追加
require 'yaml'
Dir::glob("/var/quick/companies/*").each do |f|
data = YAML.load(File.read f).merge({updated_at: File.stat(f).mtime})
File.write(f, data.to_yaml)
end
@ironsand
ironsand / gist:7343e9289b66aeb864d2
Last active August 29, 2015 14:06
ubuntu_vm_init.sh
# Chef インストールしたいけど手動しか無理そう
# VirtualBox addon
sudo apt-get update
sudo apt-get install virtualbox-guest-dkms
# Git
sudo apt-get install git
# Dropbox
@ironsand
ironsand / dotinstall_urls
Created June 2, 2014 08:17
dotinstallから動画をまとめてダウンロードを途中でめんどくさくなってやめたスクリプト
require 'nokogiri'
require 'open-uri'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
doc = Nokogiri::HTML open ARGV[0]
urls = doc.search("a.lesson_title").map{|n| n['href']}
vimeo_urls = urls.map do |url|
driver.navigate.to "http://dotinstall.com#{url}"
doc = driver.page_source
@ironsand
ironsand / gist:9708857
Created March 22, 2014 15:20
emacsで数学記号を入力するキーバインド
(global-set-key "\M-^" (lambda () (interactive) (insert "|")))
(global-set-key "\M-i" (lambda () (interactive) (insert "∫")))
(global-set-key "\M-s" (lambda () (interactive) (insert "Σ")))
(define-key text-mode-map "\M-s" (lambda () (interactive) (insert "Σ")))
(global-set-key "\M-8" (lambda () (interactive) (insert "∞")))
(global-set-key "\M-e" (lambda () (interactive) (insert "∈")))
(global-set-key [(meta shift e)] (lambda () (interactive) (insert "∃")))
(global-set-key "\M-p" (lambda () (interactive) (insert "π")))
(global-set-key [(meta shift p)] (lambda () (interactive) (insert "Π")))
(global-set-key "\M-u" (lambda () (interactive) (insert "∪")))