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
"no ruby, no life!" | |
# => {"no"=>2,"ruby"=>1,"life"=>1} | |
str = "no ruby, no life!" | |
# A.1 | |
str.scan(/\w+/).each_with_object(Hash.new(0)){|e,h| h[e]+=1} | |
# => {"no"=>2, "ruby"=>1, "life"=>1} | |
# A.2 |
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
export RUBY_DEBUG_PORT=1234 | |
export POW_WORKERS=1 |
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
$ git annotate <ファイル名> |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.Serialization; | |
using System.Web.Script.Serialization; | |
namespace ConsoleApplication2 | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Runtime.Serialization; | |
namespace ConsoleApplication | |
{ | |
[DataContract] |
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
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \ | |
| while read i; do | |
sudo rm /usr/local/${i} | |
done | |
sudo rm -rf /usr/local/lib/node \ | |
/usr/local/lib/node_modules \ | |
/var/db/receipts/org.nodejs.* | |
sudo rm -rf ~/.npm |
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
# tablish | |
# tableish('table tr', 'th,td') | |
find('table').all('tr').map { |row| row.all('th, td').map { |cell| cell.text.strip } } | |
# ex. | |
Then /^the table should be:$/ do |table| | |
table.diff!(find("table").all('tr').map { |row| row.all('th, td').map { |cell| cell.text.strip } }) | |
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
# -*- encoding: utf-8 -*- | |
# TED Subtitles sample | |
require 'json' | |
require 'open-uri' | |
base_url = 'http://www.ted.com/talks/subtitles' | |
id = 1405 | |
url_en = "#{base_url}/id/#{id.to_s}/lang" |
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
Marco Tempest: What I'd like to show you today | |
今日お見せするのは | |
is something in the way of an experiment. | |
まだ実験中のものです | |
Today's its debut. | |
今日が初披露になります | |
It's a demonstration of augmented reality. |
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
{{ "4048687158" | amazon_medium_image }} | |
{{ "4798122971" | amazon_medium_image }} |
OlderNewer