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
# Send Japanese mail using Gmail SMTP server. You need tlsmail. | |
# $ sudo gem install tlsmail | |
require "rubygems" | |
require "tlsmail" | |
require "nkf" | |
require "net/smtp" | |
def sendgmail(from, to, subject, body, user, pass, host = "smtp.gmail.com", port = 587) | |
body = <<EOT |
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
module Jekyll | |
class MathJaxBlockTag < Liquid::Tag | |
def render(context) | |
'<script type="math/tex; mode=display">' | |
end | |
end | |
class MathJaxInlineTag < Liquid::Tag | |
def render(context) | |
'<script type="math/tex">' | |
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
$ rails console | |
Loading development environment (Rails 3.0.6) | |
ruby-1.8.7-p334 :001 > r = Rails.application.routes | |
Gives you a handle of all the routes (config/routes.rb) | |
#Inspect a named route: | |
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path) | |
=> {:action=>"destroy", :controller=>"sessions"} |
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
@import "compass/utilities/general/clearfix"; | |
$gutter-width: 10px; // All grids systems have the same gutter width | |
$float-direction: left; | |
$left-gutter-width: ceil($gutter-width / 2) !default; | |
$right-gutter-width: $gutter-width - $left-gutter-width !default; | |
$base-line-height: 21px; | |
$show-grid-background: false; | |
@mixin centered { |
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
class String | |
def sex_code | |
if ["male", "男"].include? self | |
0 | |
elsif self == "女" | |
1 | |
else | |
self | |
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
Index: src/engine/state/SKKEvent.h | |
=================================================================== | |
--- src/engine/state/SKKEvent.h (revision 157) | |
+++ src/engine/state/SKKEvent.h (working copy) | |
@@ -71,7 +71,8 @@ | |
PrevCandidate = (1 << 11), | |
RemoveTrigger = (1 << 12), | |
InputChars = (1 << 13), | |
- CompConversion = (1 << 14) | |
+ CompConversion = (1 << 14), |
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
begin | |
require 'compass' | |
require 'compass/exec' | |
rescue LoadError | |
require 'rubygems' | |
require 'compass' | |
require 'compass/exec' | |
end | |
module Jekyll |
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
# encoding: utf-8 | |
require 'rubygems' | |
require 'sinatra/base' | |
require 'sinatra/reloader' | |
require 'rack/rewrite' | |
require 'haml' | |
class App < Sinatra::Base | |
enable :inline_templates |
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 'rubygems' | |
require 'spork' | |
#uncomment the following line to use spork with the debugger | |
#require 'spork/ext/ruby-debug' | |
Spork.prefork do | |
require File.expand_path(File.dirname(__FILE__)) + "/test_prefork" | |
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
$ ./executable-with-subcommands-using-thor.rb | |
Tasks: | |
executable-with-subcommands-using-thor.rb help [TASK] # Describe available tasks or one specific task | |
executable-with-subcommands-using-thor.rb subA [TASK] # Execute a task in namespace subA | |
executable-with-subcommands-using-thor.rb subB [TASK] # Execute a task in namespace subB | |
executable-with-subcommands-using-thor.rb test # test in CLI | |
$ ./executable-with-subcommands-using-thor.rb help | |
Tasks: | |
executable-with-subcommands-using-thor.rb help [TASK] # Describe available tasks or one specific task |
OlderNewer