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
| timeit = function(fn) { | |
| var a = (new Date()).valueOf(); | |
| fn(); | |
| console.log((new Date()).valueOf() - a); | |
| } | |
| this.renderWithJS = function() { | |
| timeit(function() { | |
| var d = ['<ul class="list-group">']; | |
| var i, user; |
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 timeit | |
| import threading | |
| def lf(lst): | |
| for i in range(10000): | |
| lst.append(i) | |
| def f1(): | |
| lst = [] | |
| lf(lst) |
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 timeit | |
| import threading | |
| def lf(lst): | |
| for i in range(10000): | |
| lst.append(i) | |
| def f1(): | |
| lst = [] | |
| lf(lst) |
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 timeit | |
| import threading | |
| lst = [] | |
| def lf(): | |
| for i in range(10000): | |
| lst.append(i) | |
| def f1(): |
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 timeit | |
| import threading | |
| lst = [] | |
| def lf(): | |
| del lst[:] | |
| for i in range(10000): | |
| lst.append(i) | |
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 threading | |
| import time | |
| from contextlib import contextmanager | |
| @contextmanager | |
| def timeit(exception=Exception): | |
| start = time.time() | |
| yield | |
| print(time.time() - start) |
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
| alight.directives.al.submit2 = function() { | |
| var dir = alight.directives.al.submit.apply(null, arguments); // Создаем родительскую директиву | |
| dir.doCallback = function(e) { // Подменяем метод обновления модели | |
| self.callback(); | |
| scope.$scan(); | |
| return true; | |
| }; | |
| return dir; | |
| } |
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 os | |
| import bottle | |
| os.chdir(os.path.dirname(os.path.abspath(__file__))) | |
| @bottle.route('/') | |
| def index(): | |
| return b'Hello world' | |
| application = bottle.default_app() |
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
| curl -X PUT 10.0.3.16:9200/btest -d ' | |
| { | |
| "settings" : { | |
| "index" : { | |
| "analysis" : { | |
| "analyzer" : { | |
| "my_analyzer" : { | |
| "type" : "custom", | |
| "tokenizer" : "lowercase", | |
| "filter" : ["my_ngram"] |
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
| from eps_get import EPS | |
| import core, app # load app | |
| import sys | |
| def call_eps(name): | |
| EPS.system.start() | |
| fn = EPS | |
| for k in name.split('.')[1:]: |
OlderNewer