Programming

[Global] Country code and Dial (phone) codes json formate (English, Traditional Chinese and Simplified Chinese Version)

Country codes and Dial codes (total 95). If more complete’s conuntry code you needed. you can visited 249 Country codes json formate (En, Traditional Chinese and Simplified Chinese Version)

Include English(en) version, Traditional Chinese(tw) version, Simplified Chinese(cn) version

Continue Reading

各國國家編碼與電話編碼對照 json 格式 (繁體/简体/En版)

這裡提供全世界國家編碼與電話編碼json格式內容,共95國 (如果僅需要更完整的國家編碼 249請參考 各國國家編碼 json 格式 繁體/簡體/英文 三種版本 )

包括三種語系: (1)繁體版 (2)簡體版 (3)英文版本 最後還有三種語系結合的json內容

Continue Reading

將谷歌excel 試算表作為資料庫 [教學]

將你的Google Spreadsheet 設定為公開

檔案>發佈到網路

Continue Reading

瀏覽器語言偵測

Language of the browser: zh-TW

var x = "Language of the browser: " + navigator.language;

var txt = "";
txt += "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt += "<p>Browser Name: " + navigator.appName + "</p>";
txt += "<p>Browser Version: " + navigator.appVersion + "</p>";
txt += "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt += "<p>Browser Language: " + navigator.language + "</p>";
txt += "<p>Browser Online: " + navigator.onLine + "</p>";
txt += "<p>Platform: " + navigator.platform + "</p>";
txt += "<p>User-agent header: " + navigator.userAgent + "</p>";
<script type=text/javascript>
        // if( (/http\:\/\/t\.smartisan\.com\/smartisan\/modules\/index\/\#\/$/g).test(location.href)) {
        if( (/http\:\/\/www\.smartisan\.com.$/g).test(location.href) || (/http\:\/\/www\.smartisan\.com\/\#\/$/g).test(location.href)) {
            // ['ja', 'en-GB', 'en', 'en-US', 'fr', 'es', 'ko', 'de'];
            // 首页,如果是英文环境,则跳到 en
            if((/en/gi).test(navigator.language)) {
                location.href = 'http://www.smartisan.com/en/';
            }
            // 首页,如果是日文环境,则跳到 jp
            else if((/(jp|ja)/gi).test(navigator.language)){
                location.href = 'http://www.smartisan.com/jp/';
            }
        }
    </script>

Continue Reading

工程師多數靠自學,還需要大學學位嗎?[轉載]

根據Stack Overflow網站2016年開發者調查發現,有56%的開發人員沒有計算機科學或相關領域的大學學位。開發人員最喜歡學習的方式是“自學”(至少69%的受訪者表示他們是部分自學;而13%的受訪者則是完全自學)。

但是,是否大多數公司都要求學位?

在 Stack Overflow Jobs(所有地區)列出的4,499個職位中,約61%(2,739個)沒有要求“學位”或“學士學位”,其他39%的工作崗位則在招聘要求中註明學位,可能是硬性要求也可以是其愛好。

有趣的是,按區域篩選時,在美國發布的需要學位的工作的百分比更高。美國列出的2,287個工作中,搜索出1,198個註明學位的職位,這意味著48%(1,089個)企業沒有把“學位”或“學士學位”作為要求之一,其餘52%的美國工作把學位作為應聘者的要求或愛好。

所以,有些公司需要學位,但這並不意味著如果你有大學學位就有超過50%的機會獲得作為開發人員的工作,證明你能做什麼和你做了什麼的能力將總是比你是否有學位更重要,即使在公司已經列出學位作為要求的情況下。

培訓可以替代學位嗎?

Continue Reading

注意! Google 宣布,將獨立行動網頁搜尋引擎

根據 Search Engine Land 報導,數月內,Google將會獨立行動版網頁搜尋索引,讓用戶們可以擁有更好的體驗。

圖片來源: Search Engine Land

Continue Reading

Content Security Policy 內容安全策略

https://www.smashingmagazine.com/2016/09/content-security-policy-your-future-best-friend/ http://www.ruanyifeng.com/blog/2016/09/csp.html

Content Security Policy - 簡稱 CSP,是一個瀏覽器安全保護使用者的策略。

主要用於降低 cross-site scripting (XSS) 的風險。

網站傳送Header時﹑夾帶 CSP header 告訴瀏覽器哪些是合法的內容,哪些是不合法的。

在基本的規則中,Header meta name 命名為 Content-Security-Policy 接下來就可以定義規則 定義的方式可以依照你使用的環境及語法而定 首先可以直接使用HTML meta的方式來定義 例如:

<meta http-equiv="Content-Security-Policy" content="script-src 'self'; object-src 'none'; style-src cdn.example.org third-party.org; child-src https:">

也可以透過 HTTP 的header訊息 : Content-Security-Policy 這裡主要會針對PHP header的方式來定義 這裡是一個PHP範例:

<?php
    header("Content-Security-Policy: <your directives>");
?>

通常,在定義CSP規則時,可以定義合法的圖片來源、script 來源、css來源、iframe來源 當然,也可以直接讓本文的script合法,但不建議這樣處理。例如,我們會再本頁HTML中用