This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Asynchronous requests in Flask with gevent""" | |
| from time import time | |
| from flask import Flask, Response | |
| from gevent.pywsgi import WSGIServer | |
| from gevent import monkey | |
| import requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| license: gpl-3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0 info it worked if it ends with ok | |
| 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'init' ] | |
| 2 info using npm@3.10.10 | |
| 3 info using node@v6.10.1 | |
| 4 verbose run-script [ 'preinit', 'init', 'postinit' ] | |
| 5 info lifecycle ghost@1.0.0-alpha.17~preinit: ghost@1.0.0-alpha.17 | |
| 6 silly lifecycle ghost@1.0.0-alpha.17~preinit: no script for preinit, continuing | |
| 7 info lifecycle ghost@1.0.0-alpha.17~init: ghost@1.0.0-alpha.17 | |
| 8 verbose lifecycle ghost@1.0.0-alpha.17~init: unsafe-perm in lifecycle true | |
| 9 verbose lifecycle ghost@1.0.0-alpha.17~init: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/qimick/Downloads/Ghost-master/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/go/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -----npm-debug.log--------- | |
| 0 info it worked if it ends with ok | |
| 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'init' ] | |
| 2 info using npm@3.10.10 | |
| 3 info using node@v6.10.1 | |
| 4 verbose run-script [ 'preinit', 'init', 'postinit' ] | |
| 5 info lifecycle ghost@1.0.0-alpha.17~preinit: ghost@1.0.0-alpha.17 | |
| 6 silly lifecycle ghost@1.0.0-alpha.17~preinit: no script for preinit, continuing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def hello(task, sleep_seconds): | |
| print('{}:hello'.format(task)) | |
| await asyncio.sleep(sleep_seconds) | |
| print('{}:world!'.format(task)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python2 | |
| import csv | |
| import sys | |
| from sys import stdout, stderr | |
| import os | |
| import argparse | |
| class RetainValueIterator(object): | |
| def __init__(self, f): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf8 | |
| # 什么是lambda函数?它有什么好处?另外python在函数式编程方面提供了些什么函数和语法? | |
| # - lambda 就是匿名函数 | |
| # - 好处: 可以动态生成一个函数对象,不用给这个对象命名,污染名字空间 | |
| # - 函数:map()/filter() | |
| # - 语法:可以函数内部定义函数,闭包支持 | |
| # 详细说说tuple、list、dict的用法,它们的特点; | |
| # - tuple 固定长度的子项不可变的顺序型容器,一般用来做常量(策划配表)或者表示少量属性的对象(比如pos)表示 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "firestarter", | |
| "version": "0.0.0", | |
| "scripts": { | |
| "ng": "ng", | |
| "start": "ng serve", | |
| "build": "ng build --prod", | |
| "test": "ng test --watch false", | |
| "lint": "ng lint", | |
| "e2e": "cypress run", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
OlderNewer