Skip to content

Instantly share code, notes, and snippets.

View iberianpig's full-sized avatar

Kohei Yamada iberianpig

View GitHub Profile
@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'
@tatsuro-ueda
tatsuro-ueda / GitHub Pagesの開設のしかた.md
Created September 3, 2012 10:49
GitHub Pagesの開設のしかた

##GitHub Pagesの開設のしかた(2012年9月版)

  1. username.github.comという名前のリポジトリをつくる

  2. つくったリポジトリに入る

  3. 「Admin」をクリック

  4. 下にスクロール

@sonots
sonots / GC.stat.md
Last active October 27, 2015 00:57

2.1

{:count=>24, # GC全体回数(major + minor)
 :heap_used=>261,
 :heap_length=>261, # ヒープに現在あるページ数
 :heap_increment=>27,
 :heap_live_slot=>94990, # 生きているオブジェクト(スロット)の数 total_allocated_object - total_freed_object
 :heap_free_slot=>11400, # すべてのページを通じて空いているスロットの数 (どのページがどのぐらい空いているとかはわからない)
 :heap_final_slot=>0,
@k2wanko
k2wanko / prepare-commit-msg
Last active October 27, 2015 23:41
prepare-commit-msg
#!/bin/sh
# https://gist.github.com/k2wanko/2217a7615b776a29d544
branch=$(git branch | grep "*" | awk '{print $2}')
# if match , it return number only. if no match, it return branch name.
parse() {
target=$(cat -)
res=$(echo $target | sed -E -e "s/.*((#|issue[s]?[\/-_]?|_|-)([0-9]*)).*/\3/g")
if [ -n "$res" ]; then
#!/usr/bin/env ruby
Dir.glob("#{ENV['HOME']}/works/**").each do |dir|
next unless File.exists?("#{File.expand_path(File.join(dir, '.git'))}")
Dir.chdir(dir) do
system("nippo.rb")
end
end
@iberianpig
iberianpig / breadcrumb_helper.rb
Last active April 13, 2017 02:51
パンくずリストを構造化付きデータごとレンダリングさせるカスタムビルダ breadcrumbs_on_railsがベース(https://github.com/weppos/breadcrumbs_on_rails)
module BreadcrumbHelper
def render_breadcrumbs
super(builder: CustomBreadcrumbsBuilder)
end
end
class CustomBreadcrumbsBuilder < BreadcrumbsOnRails::Breadcrumbs::SimpleBuilder
def initialize(context, elements, options = {})
super
@options[:separator] = ' > '
@tkyowa
tkyowa / gist:1378694
Last active May 23, 2017 08:15
ruby-debugを使ったRuby・Railsアプリケーションのデバッグ方法

ruby-debugを使ったRuby・Railsアプリケーションのデバッグ方法

インストール

# Ruby 1.8系の場合
gem install ruby-debug

# Ruby 1.9系の場合
gem install debugger
@crimsonwoods
crimsonwoods / AndroidSecurityOverView.md
Created February 18, 2013 08:34
Android Security Overviewの邦訳

Android Security Overview

原文 : http://source.android.com/tech/security/index.html

背景

Androidプラットフォームを構成する主要なブロックは下記です。

  • Device Hardware
  • Android OS
  • Androidアプリケーションランタイム
@padde
padde / lets-encrypt-nginx.md
Last active July 10, 2018 15:07
Let's Encrypt with Nginx

Let's Encrypt with Nginx

Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.

https://letsencrypt.paddd.de/

Server

I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.