Skip to content

Instantly share code, notes, and snippets.

View thash's full-sized avatar
🌵
⭐️ ⭐️ ⭐️ ⭐️ ⭐️

Takuya Hashimoto thash

🌵
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
@thash
thash / aa003
Last active August 29, 2015 13:56
$ hoge
@thash
thash / aa004
Last active August 29, 2015 13:56
--
@thash
thash / args.rb
Last active August 29, 2015 13:56
task :goodbye, [:name, :alias] do |t, args|
puts "Goodbye, #{args.name} the #{args.alias}!"
end
@thash
thash / a.rb
Last active August 29, 2015 13:57
class Budgets < Array
def select
self.class.new(super)
end
def +(other)
self.class.new(super(other))
end
end
b2 = Budgets.new
source 'https://rubygems.org'
gem 'rails', '4.0.3'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
@thash
thash / bi.sh
Last active August 29, 2015 13:57
$ cd Rwitter
$ bundle install --path .bundle/
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake (10.1.1)
...
Installing uglifier (2.5.0)
Your bundle is complete!
It was installed into ./.bundle
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
<ul>
<% @post.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
class AddNameAndIconToUsers < ActiveRecord::Migration
def change
add_column :users, :name, :string
add_column :users, :icon, :string
end
end
@thash
thash / anc.rb
Last active August 29, 2015 14:01
Enumerator::Lazy.ancestors
# => [Enumerator::Lazy, Enumerator, Enumerable, Object, Kernel, BasicObject]
<a alt="AllAbout" href="http://allabout.co.jp">リンクはこちら</a>