Skip to content

Instantly share code, notes, and snippets.

View matsubo's full-sized avatar

Yuki Matsukura matsubo

View GitHub Profile
@matsubo
matsubo / commit-msg
Created January 17, 2024 13:01 — forked from iberianpig/commit-msg
IssueID_xxxxなブランチ名の時に自動でコミットメッセージの先頭に[#IssueID]を付与するrubyスクリプト
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file, :encoding => Encoding::UTF_8)
# remove prefix issue number like [#1234] from COMMIT_EDITMSG
message = message.sub(/^\[#[0-9A-Za-z_].*\]/, "")
# remove comment
message = message.gsub(/^#(?! ------------------------ >8 ------------------------).*\n|^\n/, "")
@matsubo
matsubo / Gemfile
Last active March 12, 2021 06:37 — forked from run26kimo/Gemfile
Ruby AWS cloudwatch put log event example
gem 'aws-sdk-cloudwatchlogs'
@matsubo
matsubo / README.md
Last active February 25, 2022 01:11 — forked from gbraad/README.md
Buy me a coffee

HTML tag

Buy Me A Coffee

MarkDown

Buy Me a Coffee

@matsubo
matsubo / group_date.rb
Last active August 29, 2015 14:02 — forked from leods92/group_date.rb
MySQL ONLY. Confirmed on Rails 4.0.x, MySQL 5.6.x
module ActiveRecord
module Querying
delegate :group_date, :to => :scoped
end
module QueryMethods
def group_date(column_name = nil)
return self if column_name.blank?
# Rails uses a non standard time zone naming.
(function(){
var total = {};
var year = '2012';
var all = false;
function init(num) {
if(typeof num !== 'number') {
num = 0;
$('<div/>').css({
position: 'fixed',
left: 0,
@matsubo
matsubo / dirwatch.py
Last active December 13, 2015 23:39 — forked from narusemotoki/dirwatch.py
Improved detecting performance.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import datetime
import time
import os
from stat import *
import commands
import fnmatch
@matsubo
matsubo / OSXScreen.md
Last active December 10, 2015 01:18 — forked from bigeasy/OSXScreen.md

Installing GNU Screen on OS X in Homebrew

I want to edit in one tab, run what I edit in the other. Typical multi-view stuff. I've used Terminal.app for the last few years. Lately, however, after not long enough, Terminal gets laggy when I switch between tabs.

The stutter between edit and run is annoying, an unnacceptable. One of the major reason I've chosen to work with character based UI is because it is snappy. There shouldn't be a lag while a screen of UTF-8 is rendered in a monospace font.

The lag gets progressively longer, chipping at my productivity with irritation. The only solution is to kill all my Terminals, which essentially kills my flow. Terminal.app won't remember where I was for me. I have to initialize ever tab.

GNU Screen

@matsubo
matsubo / gist:1964936
Created March 3, 2012 08:07 — forked from tanakahisateru/gist:1344162
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \