$ deno run --allow-net --allow-read server.ts
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
| module The👨 | |
| class << self | |
| def ⛳ | |
| "🏌️" | |
| end | |
| def ❤👩 | |
| "💑" | |
| 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
| 1.method(:to_s).call # => '1' | |
| 1.method(:to_s).() # => 1 | |
| 1.method('+').call(2) # => 3 | |
| 1.method(:+).(2) # => 3 |
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
| require 'uri' | |
| require 'json' | |
| require "net/http" | |
| query = | |
| "PREFIX schema: <http://schema.org/>" + | |
| "PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>" + | |
| "SELECT ?o ?h ?w " + | |
| "WHERE {" + | |
| "?s schema:name ?o;" + |
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
| p ['🥚', '🐥', '🐔'].sort() # ["🐔", "🐥", "🥚"] |
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
| (1..2).each do |i| | |
| if i <= 1 | |
| b = true | |
| end | |
| puts "num: #{i}, bool: #{b}" | |
| end | |
| # => | |
| # num: 1, bool: true |
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 User; end | |
| hoge = User.new | |
| p hoge.class == User # => true | |
| p hoge === User # => false | |
| p User === hoge # => true | |
| case hoge.class | |
| when User |
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
| require 'benchmark' | |
| str = 'test1234hoge' | |
| r1 = /test/ | |
| r2 = /[0-9]+/ | |
| r3 = /test$/ | |
| Benchmark.bm 10 do |r| | |
| r.report 'match?' do |
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
| if False > False: | |
| print("Hello World") | |
| else: | |
| print("GoodBye") |
NewerOlder