Skip to content

Instantly share code, notes, and snippets.

@kosamari
kosamari / how_i_got_into_google.md
Last active November 1, 2023 02:16
Google に入るまでの話

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

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

前提条件

部署

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

英語

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)

<!-- 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 March 6, 2017 15:31
final compiler object for sbn compiler
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 October 11, 2016 04:52
generator function for sbn compiler
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 October 11, 2016 04:51
transform function for sbn compiler
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 October 11, 2016 04:47
parser function for sbn compiler
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 October 11, 2016 04:42
lexer function for sbn compiler
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 October 8, 2016 13:31
A code for JSConf Colombia demo :)
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 June 21, 2016 21:22
cache index.html using Service Worker
/*
* 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: '/'})
* }
*
*/