Skip to content

Instantly share code, notes, and snippets.

Avatar

takuya@mori takuya

  • Osaka City Univ
  • Osaka,Japan
View GitHub Profile
@takuya
takuya / update-unbound-blocklist.sh
Last active Jan 5, 2021
unboundのdnsブロッキングリストを更新する。
View update-unbound-blocklist.sh
#!/usr/bin/env sh
## @since 2020-05-15
## @last 2021-01-05
## @author takuya
## unbound にブロッキング
## ブロッキングするURLを定期的に更新する
function update_domain_lists(){
update280blocker
View diskutil.completion
#!/usr/bin/env bash
diskutil_options="activity
appleRAID
coreStorage
disableJournal
disableOwnership
eject
enableJournal
enableOwnership
View play_radiko_by_mplayer.py
#!/usr/bin/env python
# coding: utf-8
#/*
# * This program is free software: you can redistribute it and/or modify
# * it under the terms of the GNU General Public License as published by
# * the Free Software Foundation, either version 3 of the License, or
# * (at your option) any later version.
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
View LinkDragSelectionForChrome.user.js
// ==UserScript==
// @name LinkDragSelectionForChrome
// @description Opera like link selection for chrome.
// @namespace http://d.hatena.ne.jp/Griever/
// @author Griever
// @license MIT License
// @match http://*/*
// @match https://*/*
// @version 0.0.1
// ==/UserScript==
View amazon.js
u = location.href;
t = "takuya-hateblo-22";
a = (function(url, tag) {
asin = (function(url) {
if (r = url.match(/gp\/product\/([^\/]+)/)) {
return r[1];
} else if (r = url.match(/dp\/([^\/]+)/)) {
return r[1];
} else {
return;
View PostIT.rb
#!/usr/bin/env ruby
require "prawn/table"
require "prawn"
require 'pp'
require 'barby'
require 'barby/outputter/png_outputter'
require "barby/barcode/qr_code"
@takuya
takuya / jibun_login.js
Created Apr 23, 2019
じぶん銀行のログイン
View jibun_login.js
var jibun_login = function( id , password){
// id is like "57114-12345"
var crn = id.split(/-/);
var inputs = Array.apply(null, document.querySelectorAll("input[name^=fldLoginUserCRN]"));
var list = crn.map(function(e, i) {return [e, inputs[i]];});
list.forEach(function(e) {e[1].value = e[0]});
document.querySelector("input[type=password]").value = password;
document.querySelector("a[id=idLogon].btn").click();
}
@takuya
takuya / nhk_news_web_video.py
Last active Mar 5, 2019
nhk がiframe をnoscriptに入れちゃったので対応
View nhk_news_web_video.py
#!/usr/bin/env python
#
from lxml import html
from urllib.request import urlopen
from urllib.request import Request
from urllib.parse import urlparse
from urllib.parse import urljoin
import re, json, os, shlex, argparse, subprocess
View bitly.js
(function(long_url,callback){
bi = new URL("https://api-ssl.bitly.com/v3/shorten?");
var params = [
"login=YOUR_USER_ID",
"domain=j.mp",
"apiKey=YOUR_API_KEY",
"longUrl="+ encodeURIComponent(long_url)
]
bi.search = "?"+params.join('&')
var xhr = new XMLHttpRequest();
View pycharm
#!/usr/bin/env bash # -x -v
name=`basename $0`
APP_PATH=`realpath ~/Applications/JetBrains\ Toolbox`
declare -A APPNAME
APPNAME[phpstorm]="$APP_PATH/PhpStorm.app"
APPNAME[idea]="$APP_PATH/IntelliJ IDEA Ultimate.app"
APPNAME[pycharm]="$APP_PATH/PyCharm Professional.app"