- Web系
- Scalatra Sinatraのようなフレームワーク https://github.com/scalatra/scalatra
- Scalate テンプレートエンジン。言語を選べる http://scalate.fusesource.org/
- Play! framework 2.0 プロダクト自体がScalaで実装されている。 http://www.playframework.org/2.0
YARD CHEATSHEET http://yardoc.org
May 2020 - updated fork: https://gist.github.com/phansch/db18a595d2f5f1ef16646af72fe1fb0e
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
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 | |
# | |
# Redmineの添付ファイル付きのチケットの一覧をCSV形式で表示。 | |
# | |
# [実行方法] | |
# ruby script/runner -e production issues_with_attachments.rb | |
issues_attachments = Attachment.all.select {|item| item.container_type == 'Issue'} | |
issues_attachments.each do |item| | |
issue = Issue.find(item.container_id) |
A quick ruby command line to pretty-print piped json.
Put this somewhere in your path, with chmod +x
, then:
curl http://myapp.com/stuff.json | json
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
Ruby の HTTP クライアントライブラリ Faraday が便利そう
API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた
[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた
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
# http://d.hatena.ne.jp/haru-s/20110405/1302006637 に答えがそのままあるが、一応メモ | |
# github fork 追従 で見つけた | |
$ git remote | |
origin | |
# 本家のリモートリポジトリの短縮名を登録する. | |
$ git remote add github git://github.com/liquidz/misaki.git | |
# 本家の更新をローカルで反映させる. |
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
# config/initializers/i18n_exception_handler.rb | |
I18n.exception_handler = ->(exception, locale, key, options) do | |
if exception.is_a?(I18n::MissingTranslation) | |
Rails.logger.warn exception.message if Rails.env.development? | |
key.to_s.split('.').last.humanize | |
else | |
raise exception | |
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
SERVER = 'imap.gmail.com' | |
USERNAME = 'XXX' | |
PW = 'XXX' | |
require 'net/imap' | |
require 'net/smtp' | |
require 'tmail' | |
require 'maruku' | |
def to_markdown(text) | |
Maruku.new(text).to_html |
OlderNewer