This file contains 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
#!/usr/bin/env ruby | |
LINE_LENGTH = 78 | |
Dir.chdir(ARGV.first) if ARGV.first | |
Dir['**/*'].each do |path| | |
next unless File.file?(path) | |
next if File.basename(path) =~ /^\./ | |
separator = '*' * path.length | |
puts(separator, path, separator, '') |
This file contains 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
task :ok do | |
red = "\e[31m" | |
yellow = "\e[33m" | |
green = "\e[32m" | |
blue = "\e[34m" | |
purple = "\e[35m" | |
bold = "\e[1m" | |
normal = "\e[0m" | |
puts "", "#{bold}#{red}*#{yellow}*#{green}*#{blue}*#{purple}* #{green} ALL TESTS PASSED #{purple}*#{blue}*#{green}*#{yellow}*#{red}*#{normal}" | |
end |
This file contains 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
#Commonly used email steps | |
# | |
# To add your own steps make a custom_email_steps.rb | |
# The provided methods are: | |
# | |
# reset_mailer | |
# open_last_email | |
# visit_in_email | |
# unread_emails_for | |
# mailbox_for |
This file contains 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
named_scope :completed_scope, :conditions => "events.end_at < NOW()", :order => "events.end_at DESC" | |
def self.completed | |
with_exclusive_scope do | |
completed_scope | |
end | |
end |
This file contains 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 File.join(File.dirname(__FILE__), '..', 'test_helper') | |
class TrailingWhitespaceTest < ActiveSupport::TestCase | |
should "not have any trailing whitespace in source files because it complicates merging" do | |
errors = [] | |
Dir.chdir(Rails.root) do | |
Dir["{app,lib}/**/*.{rb,html.erb,html,yml}"].each do |path| | |
File.read(path).split(/\n/).each_with_index do |line, number| | |
if line =~ /\s$/ | |
errors << "|#{path}|#{number+1}|#{line}|" | |
end |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>あ</title> | |
</head> | |
<body> | |
<canvas id="c" width="300" height="300"></canvas> | |
<script> | |
function lineN(context, data) { |
This file contains 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 "yaml" | |
require "stringio" | |
def rewrite(buffer, data, column_width, depth=0) | |
data.sort.each do |key, value| | |
case value | |
when Hash | |
buffer.puts [" " * depth, key, ":"].join | |
rewrite(buffer, value, column_width, depth+1) | |
when Array |
This file contains 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
Disable trackpad tap: | |
synclient MaxTapTime=0 | |
Load custom xkb layout: | |
setxkbmap xx | |
Use gnome keychain for ssh keys: |
This file contains 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
Dir["#{Rails.root}/lib/hotfixes/*.rb"].each do |hotfix| | |
load hotfix | |
end |
This file contains 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
Transcribed subtitles of http://www.youtube.com/watch?v=pw6GwMTRQM0 | |
더 높이 | |
더 빨리 | |
붉은기 추켜들고 혁명의 노래높이 질붕갈이 달리자 | |
이 땅에 발붙이고 미래를 내다보며 우리의 식으로 | |
더 높이 오르자 다 빨리 달리자 |
OlderNewer