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
<html><head><script src="//api.songle.jp/v2/api.js"></script><script> | |
function onSongleWidgetAPIReady(SongleWidget) { | |
// 音楽プレーヤーを表示する | |
var player = new SongleWidget.Player({ | |
accessToken: '00000090-KtkWYyy' // アクセストークン | |
, secretToken: '2ixLaohRmaKrjS1qSHhfcMeVR27UTg8C' // シークレットトークン | |
}); | |
player.useMedia( | |
'https://youtube.com/watch?v=xOKplMgHxxA', |
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
puts readlines.map(&:to_i).sum |
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
puts gets.to_i.to_s(2) | |
=begin | |
7 | |
が | |
111 | |
=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
x = readlines.map{|line| line.chomp.split(/\s/).map(&:to_i)} | |
puts x.map{|row| row.map{|i| i+1} }.map{|row| row.join(" ")}.join("\n") | |
=begin | |
1 1 | |
1 1 | |
が | |
2 2 | |
2 2 | |
=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
$git add -A | |
$git commit -m "Update application" | |
$git push heroku master | |
$heroku run rails db:migrate |
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
case (foo <=> bar) <=> 0 | |
when 0 | |
#等しい時 | |
when 1 | |
# fooのほうが大きい時 | |
else | |
# fooのほうが小さい時 | |
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
a=[1,2].each_with_index.max[1]+1 | |
#=>2 | |
a=[1,2].each_with_index.min[1]+1 | |
=>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
puts [*?a..?z].size | |
=>26 |
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 'complex' | |
p Math.sqrt(2) | |
#=>1.4142135623730951 |
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
n,T=gets.split.map &:to_i; |
NewerOlder