Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Follow your passion.

Hank Wang hanksudo

:octocat:
Follow your passion.
  • Taipei, Taiwan & Tokyo, Japan
View GitHub Profile
@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active Jan 26, 2022
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)
View Front-end-Developer-Interview-Questions-TC.md

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

@hanksudo
hanksudo / promise.race.js
Last active Dec 6, 2021
nodejs promise race
View promise.race.js
let promiseA = new Promise((resolve) => {
const timeout = 100 + Math.floor(Math.random() * 1900)
setTimeout(() => resolve('A'), timeout);
console.log('A timeout', timeout)
})
let promiseB = new Promise((resolve) => {
const timeout = 100 + Math.floor(Math.random() * 1900)
setTimeout(() => resolve('B'), timeout);
console.log('B timeout', timeout)
@hanksudo
hanksudo / stdev.js
Created Jul 18, 2013
Standard deviation(STDEV) with JavaScript
View stdev.js
var stdev = function(arr) {
var n = arr.length;
var sum = 0;
arr.map(function(data) {
sum+=data;
});
var mean = sum / n;
@hanksudo
hanksudo / enable-ant-aliasing-vscode.md
Last active Oct 23, 2021
Enable font anti-aliasing on VS Code
View enable-ant-aliasing-vscode.md
vim /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css

add to .editor-container section

-webkit-font-smoothing: antialiased;
@hanksudo
hanksudo / last_or_next_weekday.py
Created Apr 30, 2015
(Python) Find next weekday or last weekday
View last_or_next_weekday.py
from datetime import timedelta
def next_weekday(date, weekday):
day_gap = weekday - date.weekday()
if day_gap <= 0:
day_gap += 7
return date + timedelta(days=day_gap)
@hanksudo
hanksudo / combineAndKeepOrder.go
Created Aug 18, 2021
(go) combine two array and keep order
View combineAndKeepOrder.go
package main
import "log"
func main() {
result := combineAndKeepOrder([]string{"a", "b", "c"}, []string{"c", "a", "d"})
log.Println(result, testEq(result, []string{"c", "b", "a", "d"}))
result = combineAndKeepOrder([]string{}, []string{"c", "a", "d"})
log.Println(result, testEq(result, []string{"c", "a", "d"}))
@hanksudo
hanksudo / GetTweetId.py
Created May 19, 2011
Regex : Get Tweet Id by tweet
View GetTweetId.py
import re
s = 'https://twitter.com/#!/twitter/status/70943739882913792'
print re.search('/status/(\d+)', s).group(1)
@hanksudo
hanksudo / remove-storyboard.md
Last active Dec 8, 2020
Initial iOS project without Storyboard (remove storyboard)
View remove-storyboard.md
  1. Remove Main.storyboard file
  2. Remove Main interface in Deployment Info

Screen Shot 2020-12-08 at 12 11 07

  1. Remove UISceneStoryboardFile key in Info.plist
<key>UISceneStoryboardFile</key>
View rxswift_note.md
  • Composable, Reusable
  • Declarative
  • Immutable

Observable

Fundamental part of RxSwift, Read-only

Create and subscribe Observable