Skip to content

Instantly share code, notes, and snippets.


Kosuke Yamashita ochaochaocha3

View GitHub Profile
ochaochaocha3 / munin_http_loadtime.go
Created Sep 5, 2019
View munin_http_loadtime.go
package main
import (
ochaochaocha3 / router.go
Created Aug 19, 2019
controllers/router.go の Setup 関数の引数を変える
View router.go
package controllers
import (
// Setup sets up all controllers.
func Setup(e *echo.Echo) {
cRoot := RootController{Router: e.Router()}
ochaochaocha3 /
Last active Jul 10, 2019
Ruby Quiz - Postfix to Infix (#148) 翻訳

Ruby Quiz(James Edward Gray II氏が管理)の#148「Postfix to Infix」の一部の翻訳(意訳を含む)。

クイズの概要 Quiz Summary

The big advantage of postfix expressions is that they are built with a stack in mind. This turns out to be a powerful way to do math both for computers and humans. HP makes some great RPN calculators that literally display a stack on the screen and give you the tools the manipulate it. To handle the expression:

2 3 +


ochaochaocha3 / convertPageToSDBoard.php
Last active Jun 6, 2019
MediaWikiのページをStructured Discussionsボードに変換するメンテナンススクリプト
View convertPageToSDBoard.php
require_once __DIR__ . '/maintenance/Maintenance.php';
* ページを Structured Discussions ボードに変換する。
class ConvertPageToSDBoard extends Maintenance {
public function __construct() {
ochaochaocha3 / exclude-DS_Store.js
Created Jun 2, 2018
ファイル名の配列から .DS_Store を除外する
View exclude-DS_Store.js
// ファイル名の配列
var files = [
'dir/.DS_Store', 'dir/img.jpg', 'dir2/img2.png'
// filterで.DS_Storeを除外する
.filter(filename => !filename.endsWith('.DS_Store'));
ochaochaocha3 /
Last active Dec 27, 2017
Ubuntu 17.10でOpenCVをインストールしたときの手順
# ライブラリのインストール
# 参照:
sudo apt install build-essential
sudo apt install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
sudo apt install qtbase5-dev libvtk6-dev
# CMakeでMakefileを作る
ochaochaocha3 / bcdice_wrap.rb
Created Jul 1, 2017
View bcdice_wrap.rb
# frozen_string_literal: true
require "bcdiceCore"
require "diceBot/DiceBot"
require "diceBot/DiceBotLoader"
class BCDice
VERSION = "2.02.70"
# BCDiceのコミット11ee56c以降で可能
# @see
ochaochaocha3 / DodontoFServer_callgraph.rb
Last active Jun 24, 2017
View DodontoFServer_callgraph.rb
IDENTIFIER_PATTERN = /[A-Za-z_][A-Za-z0-9_]*/
FUNC_PATTERN = /\Adef\s*((?:DodontoFServer|self)\.)?(#{IDENTIFIER_PATTERN})/o
class DodontoFMethod <, :decl_line, :lines, :class_method)
def to_s
"<#{self.class_method ? 'class_method' : 'method'} #{}>"
dodontof_methods = []
ochaochaocha3 /
Last active Jun 14, 2017
CentOS 7でHTTP/2に対応したnginxのRPMを自動生成する
ochaochaocha3 / bcdiceCui.rb
Created May 29, 2017
View bcdiceCui.rb
bcdice_root = File.expand_path(File.dirname(__FILE__))
irc_dir = "#{bcdice_root}/irc"
require 'bcdiceCore'
require 'net/irc'
require 'irc/ircBot'