Skip to content

Instantly share code, notes, and snippets.

View hanksudo's full-sized avatar
:octocat:
Follow your passion.

Hank Wang hanksudo

:octocat:
Follow your passion.
View GitHub Profile
@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active May 2, 2024 06:26
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

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

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

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

@hanksudo
hanksudo / gist:847fd0c35afe7929f0abbbb780c86557
Last active March 8, 2024 23:42
Install PHP 7 on Ubuntu 12.04
sudo apt-get install python-software-properties
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y

purge php5

sudo apt-get remove php5-common -y
@hanksudo
hanksudo / last_or_next_weekday.py
Created April 30, 2015 18:27
(Python) Find next weekday or last weekday
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 / co.go
Created January 23, 2024 07:25
coroutine experiment in python and go
package main
import (
"fmt"
"time"
)
func a() string {
fmt.Println("b")
go func() {
@hanksudo
hanksudo / Pacman.java
Created May 22, 2013 09:48
[Java] Simple Pacman
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.net.URL;
import javax.swing.ImageIcon;
@hanksudo
hanksudo / enable-ant-aliasing-vscode.md
Last active September 27, 2023 12:30
Enable font anti-aliasing on VS Code
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 / xmltest.erl
Created October 20, 2011 06:40
simple sample to parse XML by xmerl
%%% xmltest.erl
%%%
%%% @author Hank Wang <drapho@gmail.com>
%%%
%%% @doc simple sample to parse XML by xmerl
%%%
-module(xmltest).
-include_lib("xmerl/include/xmerl.hrl").
@hanksudo
hanksudo / PostgreSQL_Note.md
Last active August 7, 2023 07:41
PostgreSQL Note
@hanksudo
hanksudo / google-oauth2.md
Last active June 27, 2023 08:37
Get access token from Google OAuth2
  1. Create OAuth client ID from Google Credentials
  2. Request OAuth on browser

I use business.manage as scope here, change to yours

https://accounts.google.com/o/oauth2/auth?client_id=<CLIENT_ID>&redirect_uri=http://localhost&scope=https://www.googleapis.com/auth/business.manage&access_type=offline&response_type=code

If success, you will get a code from the url.

@hanksudo
hanksudo / app.js
Created October 20, 2022 14:57
React (standalone)
'use strict';
function App(props) {
return <h1>Hello, world!</h1>
}
ReactDOM.render(<App />, document.querySelector('#root'));