| Tables | Are | Cool |
|---|---|---|
| ほげほげ | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $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
| #include<stdio.h> | |
| int main(int argc, const char * argv[], char *envp[], char *apple[]){ | |
| int i = 0; | |
| for (i = 0; i < argc; i++) { | |
| printf("argv[%02d]: [%s]\n", i, argv[i]); | |
| } | |
| for (i = 0; envp[i] != NULL; i++) { | |
| printf("envp[%02d]: [%s]\n", i, envp[i]); |
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 Foo | |
| attr_reader :bar | |
| def initialize | |
| @bar = 'bar' | |
| end | |
| def show | |
| puts bar | |
| end | |
| 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
| find . -name "*.rb" | xargs ls -lT | awk '{ printf "%10s %s-%02s-%02s %s %s\n", $5, $9, $6, $7, $8, $10 }' | |
| 1308 2014-12-07 23:43:15 ./lib/kanojo_bot.rb | |
| 1772 2014-12-10 00:24:30 ./lib/text_processor.rb | |
| 1880 2014-12-10 00:24:30 ./lib/twitter_wrapper.rb | |
| 775 2014-12-06 23:53:15 ./spec/data/format_check_spec.rb | |
| 387 2014-12-10 00:24:30 ./spec/lib/text_processor_spec.rb | |
| 803 2014-12-06 23:53:15 ./spec/spec_helper.rb |
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
| # ここのコードを修正して使っている(キーワードの種類をCSVの最後に追加) | |
| # http://kzy52.com/entry/2014/10/05/195534 | |
| require 'csv' | |
| original_data = { | |
| wikipedia: 'jawiki-latest-all-titles-in-ns0', | |
| hatena: 'keywordlist_furigana.csv' | |
| } |
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
| <script type="application/ld+json"> | |
| { | |
| "@context":"http://schema.org", | |
| "@type":"EmailMessage", | |
| "description":"View this Pull Request on GitHub", | |
| "action": | |
| { | |
| "@type":"ViewAction", | |
| "url":"https://github.com/sugamasao/kanojo_bot/pull/38", | |
| "name":"View Pull Request" |
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
| # encoding:utf-8 | |
| require 'natto' | |
| require 'tempfile' | |
| # これは何 | |
| # 表記ゆれチェック用のツール(になったらいいなぁ)です | |
| # 名詞を抜き出してソートすることで、末尾の表記ゆれを確認しやすくなるかな、と思います!! | |
| # 使い方 | |
| # gem の natto と homebrew的な何かでMeCabをインストールしてると使えるよ!! |
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
| # rake hoge | |
| task :hoge do |task| | |
| p task.name # => "hoge" | |
| 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
| # ruby leap_year.rb 2000 2100 | |
| start_year = ARGV[0].to_i | |
| end_year = ARGV[1].to_i | |
| def leap_year?(year) | |
| if (year % 400).zero? | |
| true | |
| elsif !(year % 100).zero? && (year % 4).zero? | |
| true | |
| end |