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 / self-executing-anonymous-functions.js
Created April 25, 2013 19:33
self-executing-anonymous-functions
(function() {
console.log('This is a anonymous function.');
})();
var n = 1;
(function(n) {
console.log('Number : ' + n);
})(n);
@hanksudo
hanksudo / LiveDays.java
Created May 22, 2013 09:06
[Java] Calculate your age in days
import java.util.Calendar;
import java.util.Date;
public class LiveDays {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
Date today = cal.getTime();
cal.set(1985, Calendar.JANUARY, 30);
Date birthday = cal.getTime();
@hanksudo
hanksudo / LiveDays.py
Created May 22, 2013 09:20
[Python] calculate your age in days 計算你已經活了幾天
from datetime import datetime, timedelta
print '你已經活了', (datetime.now() - datetime(1985, 1, 30)).days, '天'
@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 / list_all_databases.js
Created May 24, 2013 21:11
MongoDB script: list all databases.
print('List all databases: \n');
var mongo = db.getMongo();
mongo.getDBNames().forEach(function(dbname) {
print(dbname);
});
@hanksudo
hanksudo / useful_sed.sh
Created June 4, 2013 18:33
Useful one-line scripts for sed
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
@hanksudo
hanksudo / .vimrc
Last active December 18, 2015 13:09
vim configuration
set encoding=utf-8
" Enable syntax highlighting - 開啓語法高亮顯示
syntax on
set nocompatible
" display line number on the left - 顯示行號
set number
@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active April 15, 2025 17:42
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

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

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

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

@hanksudo
hanksudo / top_10_shell_commands.sh
Last active December 19, 2015 01:29
Top 10 shell commands you currently use by https://coderwall.com/p/o5qijw Leave your top 10 below.
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head