Skip to content

Instantly share code, notes, and snippets.

View YutaGoto's full-sized avatar
:dependabot:
Working from my home!

Yuta Goto YutaGoto

:dependabot:
Working from my home!
View GitHub Profile
@YutaGoto
YutaGoto / README.md
Created March 8, 2022 16:30
DenoとHTMLとBootstrap

run

$ deno run --allow-net --allow-read server.ts 
@YutaGoto
YutaGoto / emoji.rb
Created December 17, 2020 09:14
これは 雑談Slack Advent Calendar 2020 の16日目のやつです。 https://adventar.org/calendars/5337
module The👨
class << self
def
"🏌️"
end
def ❤👩
"💑"
end
end
1.method(:to_s).call # => '1'
1.method(:to_s).() # => 1
1.method('+').call(2) # => 3
1.method(:+).(2) # => 3
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;" +
p ['🥚', '🐥', '🐔'].sort() # ["🐔", "🐥", "🥚"]
(1..2).each do |i|
if i <= 1
b = true
end
puts "num: #{i}, bool: #{b}"
end
# =>
# num: 1, bool: true
@YutaGoto
YutaGoto / fork.md
Last active January 15, 2020 07:22

フォークしたリポジトリを追従する

git remote add upstream https://github.com/imas/mokumoku.git # fork元のリポジトリを設定する。設定済みの場合は不要
git fetch upstream # fork元の最新の状態を取得する
git merge upstream/master # ローカルのブランチにマージする

参考

class User; end
hoge = User.new
p hoge.class == User # => true
p hoge === User # => false
p User === hoge # => true
case hoge.class
when User
require 'benchmark'
str = 'test1234hoge'
r1 = /test/
r2 = /[0-9]+/
r3 = /test$/
Benchmark.bm 10 do |r|
r.report 'match?' do
@YutaGoto
YutaGoto / exampleQ.py
Created May 23, 2019 16:11
1文字書き加えて "Helo World" を出力させるクイズ: Python 3.7.1
if False > False:
print("Hello World")
else:
print("GoodBye")