Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| import BaseHTTPServer | |
| from SimpleHTTPServer import SimpleHTTPRequestHandler | |
| import sys | |
| import base64 | |
| key = "" | |
| class AuthHandler(SimpleHTTPRequestHandler): | |
| ''' Main class to present webpages and authentication. ''' | |
| def do_HEAD(self): |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| -- Two dashes start a one-line comment. | |
| --[[ | |
| Adding two ['s and ]'s makes it a | |
| multi-line comment. | |
| --]] | |
| ---------------------------------------------------- | |
| -- 1. Variables and flow control. | |
| ---------------------------------------------------- |
@版本 2.0.0
譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.
此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。
Rebecca Murphey 的 Baseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。
| """ | |
| Graceful Stopper | |
| =================== | |
| Tool to stop a TCPServer (or HTTPServer) in a graceful manner (when the all | |
| currently running work is done). This script works either for forked servers or | |
| single-process servers. | |
| The graceful-stop process can be triggered by sending `SIGHUP` to server (in a | |
| forked environment, sending SIGHUP to master server, propagates to all | |
| children). Server immediately releases the listening socket (so another server |
| """ | |
| Simple view decorator for flask and mongoengine/pymongo to auto-retry with delay on | |
| pymongo.errors.AutoReconnect exception. | |
| """ | |
| from functools import wraps | |
| import time | |
| from pymongo.errors import AutoReconnect | |
| import flask |
| // Helpers. | |
| import { convertToText } from './'; | |
| /* | |
| You would call this when receiving a plain text | |
| value back from an API, and before inserting the | |
| text into the `contenteditable` area on a page. | |
| */ | |
| const convertToMarkup = (str = '') => { | |
| return convertToText(str).replace(/\n/g, '<br>'); |
| // quite untested, adapted from BigstickCarpet's gist, attempt to make it simpler to use | |
| function openIndexedDB (fileindex) { | |
| // This works on all devices/browsers, and uses IndexedDBShim as a final fallback | |
| var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; | |
| var openDB = indexedDB.open("MyDatabase", 1); | |
| openDB.onupgradeneeded = function() { | |
| var db = {} |
| // LoadingScreenManager | |
| // -------------------------------- | |
| // built by Martin Nerurkar (http://www.martin.nerurkar.de) | |
| // for Nowhere Prophet (http://www.noprophet.com) | |
| // | |
| // Licensed under GNU General Public License v3.0 | |
| // http://www.gnu.org/licenses/gpl-3.0.txt | |
| using UnityEngine; | |
| using UnityEngine.UI; |