Skip to content

Instantly share code, notes, and snippets.

View minoritea's full-sized avatar

Minori Tokuda minoritea

View GitHub Profile
@minoritea
minoritea / partytown-snippet.js
Created May 8, 2023 08:09
partytown snippet(for GA4)
/* Partytown 0.8.0 - MIT builder.io */
!(function(w,p,f,c){c=w[p]=w[p]||{};c[f]=(c[f]||[]).concat(["dataLayer.push"])})(window,'partytown','forward');!function(t,e,n,i,r,o,a,d,s,c,l,p){function u(){p||(p=1,"/"==(a=(o.lib||"/~partytown/")+(o.debug?"debug/":""))[0]&&(s=e.querySelectorAll('script[type="text/partytown"]'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(d=setTimeout(f,1e4),e.addEventListener("pt0",w),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):f())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.8.0":"sandbox-sw.html?"+Date.now()),e.querySelector(o.sandboxParent||"body").appendChild(c)}function f(n,r){for(w(),i==t&&(o.forwar
@minoritea
minoritea / uuid_v7_draft3.sql
Last active April 21, 2022 01:37
uuid generator for uuid v7(draft3)
-- generator function for UUID v7 (draft3).
-- https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03
-- it also depends on gen_random_uuid.
create or replace function uuid_v7() returns uuid as $$
declare
l_unixts_text text := lpad(
to_hex(
(
extract(epoch from clock_timestamp()) * 1000
)::bigint & x'FFFFFFFFFFFF'::bigint
@minoritea
minoritea / dilly-keymap.md
Last active July 28, 2019 07:14
Dilly Keymap

Dilly 3x10 key mapping

A key mapping for Dilly 3x10. This key mapping can also be applied to other 30% keyboards.

Default layer

Q W E R T U I O P Backspace
A S D F H J K L Y Enter
Z X C G Space N M V B Shift
@minoritea
minoritea / pref.csv
Created March 26, 2018 08:08 — forked from kobaatsu/pref.csv
[都道府県一覧] #utils
北海道 HOKKAIDO hokkaido
青森県 AOMORI aomori
岩手県 IWATE iwate
宮城県 MIYAGI miyagi
秋田県 AKITA akita
山形県 YAMAGATA yamagata
福島県 FUKUSHIMA fukushima
茨城県 IBARAKI ibaraki
栃木県 TOCHIGI tochigi
群馬県 GUNMA gunma

基本型(2)

3.5, 文字列型

文字列はイミュータブルなバイト列である。 文字列はNULL文字を含む任意のデータであるが、通常はヒューマンリーダブルなテキストを表すのに使われる。 テキストはUTF-8でエンコードされたユニコード・コードポイント(Rune)の連なりとして解釈される。

len関数は文字列のバイト長を返す(Runeの数ではない)。 インデックス操作(s[i])は文字列sのi番目のバイトを返す。 文字列のインデックスの範囲(0 <= i < len(s))を超えてアクセスした場合はパニックとなる。

3. 基本型

Goの型は次の4種類に分けられる。

  1. 基本型
  2. 集成型
  3. 参照型
  4. インターフェース型

この章では基本型を扱う。基本型は数、文字列、ブール型である。 集成型は配列や構造体のような、よりシンプルな型の値の組み合わせからなる型である。

@minoritea
minoritea / 2.3.0
Created December 25, 2015 08:19
ruby-build definition for 2.3.0
install_package "openssl-1.0.1q" "https://www.openssl.org/source/openssl-1.0.1q.tar.gz#b3658b84e9ea606a5ded3c972a5517cd785282e7ea86b20c78aa4b773a047fb7" mac_openssl --if has_broken_mac_openssl
install_package "ruby-2.3.0-preview2" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0-preview2.tar.gz#cb1c745bda33ba9e812b48c87852571ef6486f985c5e6ff4508a137d1c9734a3" ldflags_dirs standard verify_openssl

#TOMLの仕様の翻訳をした話

@snowcrush #tqrk09


TOMLとは

TOML aims to be a minimal configuration file format

that's easy to read due to obvious semantics.

@minoritea
minoritea / goquu.md
Last active August 29, 2015 14:25
goquu

#Goquu

##GoでJob Queueシステムを作ってみた

@snowcrush


#Goquu

Serverspec

Serverspec Workshop(2)

Minori Tokuda


  1. Vagrant立ち上げ ======================