Skip to content

Instantly share code, notes, and snippets.

View mtoyoshi's full-sized avatar

masaki toyoshima mtoyoshi

View GitHub Profile
@mtoyoshi
mtoyoshi / encoding.rb
Created July 30, 2020 06:50
文字コード調査
open("foo.txt", "r", :encoding => "SJIS") do |f|
f.each_line do |l|
l.each_char do |c|
puts "#{c} : #{c.ord}, #{c.bytes.map {|b| "%02X" % b} }"
end
end
end
puts '本'.bytes.map {|b| "%02X" % b }
subscriptions一覧して、pushEndpointがnullじゃないものをフィルタ、nameとpushEndpointを使ってpush-auth-service-accountを設定する(設定にpushEndpointが必須なため取っている)
```
gcloud pubsub subscriptions list --format=json \
| jq -r '.[] | select(.pushConfig.pushEndpoint != null) | [.name, .pushConfig.pushEndpoint] | @sh' \
| awk '{ print "gcloud pubsub subscriptions update " $1 " --push-auth-service-account=xxxxxxx@appspot.gserviceaccount.com --push-endpoint=" $2 }' \
| sh
```
@mtoyoshi
mtoyoshi / gist:41161eb332e298e61e9f
Last active December 13, 2024 13:46
数学用語の英語
日本語 英語 備考
自然数 natural number 1,2,3... ものの個数など
整数 integer ...-2,-1,0,1,2,... 自然数に0とマイナスが加わったもの
有理数 rational number 2/3, -3/4など 割り算(分数)で表現されるもの。循環小数もOK。分母を1とすれば整数も有理数として表現できる。rationalとは理性的とか合理的とかの意味
無理数 irrational number π,e,√2など 有理数では表現できないもの
実数 actual number 有理数+無理数
複素数 complex number a+bi 実数aと実数bと虚数iを用いてa+biの形になる数
ベクトル vector 大きさに加え向きも持った量
行列 matrix
@mtoyoshi
mtoyoshi / mokumoku.html
Last active August 29, 2015 14:11
半もくもくScala
<a href="http://www.google.co.jp">Google</a>
@mtoyoshi
mtoyoshi / TypeClassPractice.scala
Last active August 29, 2015 14:09
Type Class Practice
object Main extends App {
def decorate[T](x: T)(implicit deco: Decorating[T]) = deco(x)
trait Decorating[T] {
def apply(x: T): String
}
implicit val DecoratingString = new Decorating[String] {
def apply(x: String) = s"SSS $x SSS"
<html>
<body>
<h1>toysohima test page</h1>
</body>
</html>