Skip to content

Instantly share code, notes, and snippets.

View chiastolite's full-sized avatar

Hiroyuki Morita chiastolite

View GitHub Profile
# ログからクエリ発行が多いとこを特定するために呼出元を回数順に並べるやつ
# 途中のsedは色付け用のエスケープシーケンスを消すやつ
grep 'ActiveRecord::Cause' log/development.log| sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g' | sort |uniq -c | sort -n
#!/bin/bash
if [ $# -ne 1 ]; then
echo 'Usage: git new repository_name'
exit 1
fi
REPO_NAME=$1
REPO_DIR=$(ghq root)/github.com/$(whoami)/$REPO_NAME
class Coupon < ApplicationRecord
scope :expired, -> { where('valid_until < ', Time.zone.now) }
def expired?
valid_until < Time.zone.now
end
end
@chiastolite
chiastolite / hide-eplus-failure.js
Created March 21, 2021 11:03
eplusの非当選隠し
// ==UserScript==
// @name eplusの非当選隠し
// @version 0.1
// @author @chiastolite
// @match https://north2.eplus.jp/sys/main.jsp*
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.querySelectorAll("#contents > div.appli-situation > table > tbody:nth-child(2) > tr[class='win-failure']").forEach( function(element) { element.style.display ="none"; });