Skip to content

Instantly share code, notes, and snippets.

@kosamari
kosamari / how_i_got_into_google.md
Last active Jun 8, 2020
Google に入るまでの話
View how_i_got_into_google.md

Googleに入るまでの話 (Developer Relations)

コンテキスト: https://togetter.com/li/1331865

前提条件

部署

グーグルジャパンではなくてUSの本社での採用の話。私が受けたのはSoftware EngineerではなくてDeveloper Advocate。Engineering組織の下についているのでコーディング面接有り。ただし評価項目がSWEとは異なる。

英語

View AMA_05102017.md

AMA 05102017

I'm on my way back to New York from Berlin, trying to not sleep on flight so I can beat jet lag. Here are some questions I answered to stay awake.

How are you? (asked by @johest)

I'm great. I just survived JSConfEU weekend and gave one meetup talk in Berlin. On my way back home to New York City.

What's your drawing setup? (so many asked this I can't even keep track of who did)

machine: iPad Pro 9.7 inch with matte screen protector
stylus: apple pencil
app: "Paper" by @FiftyThree (I use diagram tool almost exclusively)

View rubytag.html
<!-- This, screen reader reads the chinese character too like "chinese character ___, kan, chinese character___, ji" -->
<ruby>
<rp>(</rp><rt>Kan</rt><rp>)</rp>
<rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
<!-- This, just reads "kan ji" -->
<ruby>
<span aria-hidden="true"></span> <rp>(</rp><rt>Kan</rt><rp>)</rp>
<span aria-hidden="true"></span> <rp>(</rp><rt>ji</rt><rp>)</rp>
@kosamari
kosamari / compiler.js
Last active Mar 6, 2017
final compiler object for sbn compiler
View compiler.js
var sbn = {}
sbn.VERSION = '0.0.1'
sbn.lexer = lexer
sbn.parser = parser
sbn.transformer = transformer
sbn.generator = generator
sbn.compile = function (code) {
return this.generator(this.transformer(this.parser(this.lexer(code))))
}
@kosamari
kosamari / generator.js
Created Oct 11, 2016
generator function for sbn compiler
View generator.js
function generator (svg_ast) {
// create attributes string out of attr object
// { "width": 100, "height": 100 } becomes 'width="100" height="100"'
function createAttrString (attr) {
return Object.keys(attr).map(function (key){
return key + '="' + attr[key] + '"'
}).join(' ')
}
@kosamari
kosamari / transformer.js
Created Oct 11, 2016
transform function for sbn compiler
View transformer.js
function transformer (ast) {
var svg_ast = {
tag : 'svg',
attr: {
width: 100, height: 100, viewBox: '0 0 100 100',
xmlns: 'http://www.w3.org/2000/svg', version: '1.1'
},
body:[]
}
@kosamari
kosamari / parser.js
Last active Oct 11, 2016
parser function for sbn compiler
View parser.js
function parser (tokens) {
var AST = {
type: 'Drawing',
body: []
}
// extract a token at a time as current_token. Loop until we are out of tokens.
while (tokens.length > 0){
var current_token = tokens.shift()
// Since number token does not do anything by it self, we only analyze syntax when we find a word.
@kosamari
kosamari / lexer.js
Created Oct 11, 2016
lexer function for sbn compiler
View lexer.js
function lexer (code) {
return code.split(/\s+/)
.filter(function (t) { return t.length > 0 })
.map(function (t) {
return isNaN(t)
? {type: 'word', value: t}
: {type: 'number', value: t}
})
}
@kosamari
kosamari / CompileChallenge.sbn
Last active Oct 8, 2016
A code for JSConf Colombia demo :)
View CompileChallenge.sbn
Paper 100
Pen 0
Line 19 91 0 70
Line 0 70 39 91
Line 19 91 39 91
Line 39 91 73 68
Line 73 68 73 50
Line 73 50 46 50
Line 46 50 25 83
@kosamari
kosamari / serviceworker.js
Created Jun 21, 2016
cache index.html using Service Worker
View serviceworker.js
/*
* CHALLANGE:
* Cache `index.html` file using service worker.
*
* This bit of code is included in <script> tag of index.html
* if (navigator.serviceWorker) {
* navigator.serviceWorker.register('serviceworker.js', {scope: '/'})
* }
*
*/
You can’t perform that action at this time.