This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def each_commit(size) | |
project = Project.create!(name: "each_commit #{size}") | |
size.times.with_index(1) do |_, index| | |
project.tasks.create!(name: "Task #{index}") | |
end | |
end | |
def transaction(size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def normal_selector(array, word) | |
array.select{|hash| hash[:name].match "#{word}"}.to_a | |
end | |
def lazy_selector(array, word) | |
array.lazy.select{|hash| hash[:name].match "#{word}"}.to_a | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post | |
def initialize(title, body) | |
@title, @body = title, body | |
end | |
def render | |
<<-EOS | |
<article> | |
<h1>#{@title}</h1> | |
<p>#{@body}</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# members_controller.rb | |
class MembersController < ApplicationController | |
def destroy | |
if !checkadmin? then return end | |
@member = Member.find(params[:id]) | |
@member.destroy | |
respond_to do |format| | |
format.html { redirect_to members_url } | |
format.json { head :no_content } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class AudioManager : SingletonMonoBehaviour<AudioManager> { | |
AudioClip bgm_Game; | |
AudioClip se_Tanpopo; | |
private const int source_bgm_Game = 0; | |
private const int maxAudio = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["node-webkit", "${project_path:${folder}}"], | |
"working_dir": "${project_path:${folder}}", | |
"path": "/Applications/node-webkit.app/Contents/MacOS/" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.menu > li { | |
display: inline-block; | |
*display: inline; | |
*zoom: 1; | |
background-color: gray; } | |
footer > li { | |
display: inline-block; | |
*display: inline; | |
*zoom: 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$base-color: #f2eff0 | |
$main-color: #333333 | |
$accent-color: #1e965c | |
$base-text-color: darken($base-color, 50%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pry(main)> wp.getPosts(filter: {order: 'desc'}).first | |
=> {"post_id"=>"5904", | |
"post_title"=>"モバイルアプリ向けUIフレームワークionicがSassで作られている&AngularJSに最適化されていて俺得すぎる", | |
"post_date"=> | |
#<XMLRPC::DateTime:0x007fb3988f0068 | |
@day=29, | |
@hour=18, | |
@min=32, | |
@month=1, | |
@sec=21, |