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
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
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
# -*- coding: utf-8 -*- | |
#test on python 3.4 ,python of lower version has different module organization. | |
import http.server | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
import socketserver | |
PORT = 8080 | |
Handler = http.server.SimpleHTTPRequestHandler |
import sys, os.path, hashlib, re | |
import zipfile | |
import subprocess | |
from StringIO import StringIO | |
from io import BytesIO | |
# | |
# Passbook Hack | |
# David Schuetz | |
# 30 May 2014 |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
export class BTreeNode { | |
constructor(isLeaf) { | |
/** | |
* @type {number[]} list of values in the node | |
*/ | |
this.values = []; | |
/** | |
* @type {boolean} is a leaf | |
*/ | |
this.leaf = isLeaf; |
/** | |
* This file is based on the DataFormsJS jsxLoader which is a | |
* small browser based compiler for JSX / React. | |
* | |
* The main file is intended for browser use with a <script> tag | |
* so needed portions of the code have copied here so that it can | |
* be optimized with webpack and node using a simple API. | |
* | |
* @link https://www.dataformsjs.com | |
* @link https://github.com/dataformsjs/dataformsjs/blob/master/js/react/jsxLoader.js |