Skip to content

Instantly share code, notes, and snippets.

Avatar

Jun Morimoto mrmt

View GitHub Profile
@mrmt
mrmt / gist:1464ac88fe4dd0b61fef52872a727899
Last active Jun 17, 2020 — forked from t-yamamoto-mercury-inc/gist:b58969dcc58bb13ee4b7e2c1fc316501
Googleドライブのパスをクリップボードにコピーするブックマークレット
View gist:1464ac88fe4dd0b61fef52872a727899
javascript:(function(){
var pre = 'Googleドライブの「';
var xpath = '//*[@guidedhelpid="folder_path"]';
document.getElementsByXPath = function(expression, parentElement) {
var r = [];
var x = document.evaluate(expression, parentElement || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0, l = x.snapshotLength; i < l; i++) {
r.push(x.snapshotItem(i));
} return r;
@mrmt
mrmt / insert-japanese-day-of-the-week.el
Last active Mar 25, 2020
insert japanese day of the week
View insert-japanese-day-of-the-week.el
;; Copyright 2019 Jun Morimoto
;; This file 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, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
View gist:b09f93ca113abd9195f4a09c8a1d14bc
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
refer: whois.pir.org
domain: ORG
organisation: Public Interest Registry (PIR)
address: 1775 Wiehle Avenue
View criminal_jc.uml
participant "誤認逮捕された専門学校生" as Senmon
participant "犯罪中学生" as Criminal
participant "女子高生ら2人" as JK_2
participant "チケット販売サイト" as TicketShop
participant "落札者" as Rakusatsu
Senmon -> Criminal : チケット8万円で売ります
Criminal -> Senmon : 買います
Senmon -> Criminal : 「誤認逮捕された専門学校生」の口座を教える
Criminal -> JK_2 : チケット4万円で売ります
View slack2html.php
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
View gist:cb18ae7fb2281f3662a0
@@ -397,11 +421,15 @@
$itemVar['body'] = preg_replace_callback($delim_expr, array(&$this, '_convertDelim'), $itemVar['body']);
$itemVar['more'] = preg_replace_callback($delim_expr, array(&$this, '_convertDelim'), $itemVar['more']);
if( $stripbr ){
$itemVar['body'] = preg_replace("/([\r\n])/","$1",$itemVar['body']);
$itemVar['more'] = preg_replace("/([\r\n])/","$1",$itemVar['more']);
}
+ // mrmt
View gist:cee4d1fb779d26c3c53a
--- /usr/share/wordpress/wp-admin/import/mt.php.org 2010-09-11 13:28:52.000000000 +0900
+++ /usr/share/wordpress/wp-admin/import/mt.php 2010-09-10 21:51:19.000000000 +0900
@@ -220,6 +220,9 @@
if ( is_wp_error( $post_id ) )
return $post_id;
+ // mrmt
+ add_post_meta($post_id, 'nucleus_itemid', $post->nucleus_itemid, 0);
+
// Add categories.
View gist:5e98864eb0375e00a6ed
+++ nucleus/plugins/impexp/template/np_impexp/entry_japanese-utf8.txt.org 2010-09-11 13:14:09.265971760 +0900
--- nucleus/plugins/impexp/template/np_impexp/entry_japanese-utf8.txt 2010-09-05 10:22:30.000000000 +0900
@@ -1,6 +1,5 @@
AUTHOR: {{author}}
TITLE: {{title}}
+ ITEMID: {{itemid}}
STATUS: {{status}}
ALLOW COMMENTS: {{allow_comments}}
CONVERT BREAKS: {{convert_breaks}}
--- nucleus/plugins/NP_ImpExp.php.org 2010-09-11 13:22:20.939423749 +0900
View timer.rb
# -*- coding: utf-8 -*-
# ruby timer.rb 12:00 1 2 3 4 5 6 7 8 9 10 15 30 1m 2m 3m 4m 5m 10m 15m 20m 30m 45m 1h 1h30m 2h
require 'time'
require 'timers'
def usage
STDERR.puts "Usage: ruby timer end_time timing [timing..]"
STDERR.puts " example: ruby timer 12:00 1 2 3 5m 30m 1h"
exit
@mrmt
mrmt / GGsync.java
Last active Feb 4, 2016
softly ignore google calendar api error source/GGsync/src/com/cybozu/GGsync.java
View GGsync.java
package com.cybozu;
import java.io.File;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;