Skip to content

Instantly share code, notes, and snippets.

View linyows's full-sized avatar

Tomohisa Oda linyows

View GitHub Profile
class ApplicationController < ActionController::Base
...
# FORCE to implement content_for in controller
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end
// ==UserScript==
// @name github-build-badge
// @author linyows
// @namespace http://linyows.com/
// @description "Expand build status badge"
// @include https://github.com/*
// ==/UserScript==
(function() {
var match_witch_badge = /<a href="(http:\/\/ci[0-9]{0,3}\..*\.[a-z]{2,5}\/job\/.*)"><img src=".*" alt="Build Status" data-canonical-src=".*" style=".*"><\/a>/g;
# -*- mode: ruby -*-
# vi: set ft=ruby :
# David Lutz's Multi VM Vagrantfile
# inspired from Mark Barger's https://gist.github.com/2404910
boxes = [
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true },
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 },
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1}
]

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@linyows
linyows / generate_hosts.rb
Last active December 17, 2015 13:38
Generate the Hosts Dynamically on AWS
#!/usr/bin/env ruby
# README
#
# Generate the Hosts Dynamically
# ==============================
#
# Usage
# -----
#
@linyows
linyows / create_snapshot.rb
Last active December 17, 2015 17:18
Create snapshot of volume on AWS
#!/usr/bin/env ruby
# README
#
# Create snapshot
# ===============
#
# Create snapshot of volume. and generation management.
#
# Usage
shared_context "for_extending" do
context "extended with MyModule" do
before(:all){ subject.extend(MyModule) }
it "should define #some_method" do
subject.should respond_to(:some_method)
end
yield
end
end
#!/bin/bash
cd /var/lib/jenkins/plugins/embeddable-build-status/status
wget -O success.png https://raw2.github.com/badges/shields/master/static/travis/travis_passing.png
wget -O failure.png https://raw2.github.com/badges/shields/master/static/travis/travis_failing.png
wget -O running.png https://raw2.github.com/badges/shields/master/static/travis/travis_pending.png
wget -O unknown.png https://raw2.github.com/badges/shields/master/static/travis/travis_unknown.png
wget -O unknown.png https://raw2.github.com/badges/shields/master/static/travis/travis_unknown.png
@linyows
linyows / test.md
Created July 14, 2013 07:52
test gist description

hello word

this is a test.

hi

  • aaa
  • bbb
@linyows
linyows / file0.txt
Created August 21, 2013 02:59
Mac上のstandaloneなrbenvで日本語文字化けとssl証明書エラーがでないようにする方法 ref: http://qiita.com/linyows@github/items/04c1be6bcd2da3cf3f1c
$ brew update
$ brew install readline openssl curl-ca-bundle
$ env RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install <version>