Skip to content

Instantly share code, notes, and snippets.

View masutaka's full-sized avatar

Takashi Masuda masutaka

View GitHub Profile
@nownabe
nownabe / .commit_template
Created July 5, 2016 06:54
Emojiで楽しく綺麗なコミットを手に入れる
# ==== Emojis ====
# 🐛 :bug: バグ修正
# 👍 :+1: 機能改善
# ✨ :sparkles: 部分的な機能追加
# 🎉 :tada: 盛大に祝うべき大きな機能追加
# ♻️ :recycle: リファクタリング
# 🚿 :shower: 不要な機能・使われなくなった機能の削除
# 💚 :green_heart: テストやCIの修正・改善
@stanaka
stanaka / mackerel-graph-builder.html
Last active December 7, 2016 13:15
save this html as a local file, then open the file.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Mackerel Graph Builder</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
function update() {
var d = $("#def")[0].value;
var o = $("#org")[0].value;
@kano-e
kano-e / fftt-advent-calendar-2015-22.md
Last active December 25, 2015 13:58
「自分が文章を書く時と、開発してる時って、実は同じようなこと考えて作業を進めてる」
@masutaka
masutaka / rbenv-ruby.md
Last active February 18, 2024 13:32
【決定版】rbenv を使った ruby のインストール

rbenv および Ruby-2.5.0 のクリーンインストール

  1. Homebrew の rbenv や ruby-build をインストールしていたら、もろもろ削除する

    $ brew uninstall --force rbenv ruby-build
    $ rm -rf ~/.rbenv
    
  2. rbenv をインストールする

@tmd45
tmd45 / Gemfile
Last active August 29, 2015 14:02
nippo.rb; refs. Githubで今日なにをしたか、調べるスクリプトを書いた - きたけーTechブログ http://kitak.hatenablog.jp/entry/2014/04/22/013849
source 'https://rubygems.org'
ruby '2.1.5'
gem 'i18n'
gem 'activesupport'
gem 'octokit'
@sue445
sue445 / equal_with_indifferent_access.rb
Last active February 10, 2023 14:29
[RSpec custom matcher] match hashes with indifferent access
# match hashes with indifferent access
#
# example)
# expect({"key1" => 1, :key2 => 2}).to equal_with_indifferent_access(key1: 1, key2: 2)
RSpec::Matchers.define :equal_with_indifferent_access do |expected|
match do |actual|
actual.with_indifferent_access == expected.with_indifferent_access
end
anonymous
anonymous / emacs24_3_inline_memleak.sh
Created January 22, 2014 04:06
emacs 24.3でdistnotedを暴走させないパッチ+inlineパッチのビルド手順です。sakito.jpの手順を修正したものです。
EMACS_VER=24.3
curl -O http://ftp.gnu.org/pub/gnu/emacs/emacs-${EMACS_VER}.tar.gz
curl -O https://gist.github.com/anonymous/8553178/raw/c0ddb67b6e92da35a815d3465c633e036df1a105/emacs.memory.leak.aka.distnoted.patch.diff
svn co http://svn.sourceforge.jp/svnroot/macemacsjp/inline_patch/trunk inline_patch
tar xvfz emacs-${EMACS_VER}.tar.gz
cd emacs-${EMACS_VER}
@sfate
sfate / vim-on-heroku.sh
Created June 7, 2012 14:39 — forked from naaman/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@tanakahisateru
tanakahisateru / pagination_sample.php
Created February 24, 2012 12:42
汎用ページネーションとりあえずできた
<?php
$pagination = new Pinoco_Pagination(
// How many elements?
function($pagination) {
return $pagination->db->prepare(
"SELECT count(id) as c FROM ..."
)->query()->fetchOne()->c;
},
// What to be shown?
function($pagination, $offset, $limit) {
<?php
class Singleton {
private static $_self = null;
public $count = 0;
private function __construct() {
}
public static function getInstance() {
if (is_null(self::$_self)) {