Skip to content

Instantly share code, notes, and snippets.

Jonas Brunsgaard brunsgaard

Block or report user

Report or block brunsgaard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View s3_flask_python.py
import threading
import boto3
import flask
local = threading.local()
class S3:
View s3_flask_python.py
```python
import threading
import boto3
import flask
local = threading.local()
View s3_flask_python.py
```python
import threading
import boto3
import flask
local = threading.local()
View s3_flask_python.py
```python
import threading
import boto3
import flask
local = threading.local()
View s3_flask_python.py
```python
import threading
import boto3
import flask
local = threading.local()
View s3_flask_python.py
```python
import threading
import boto3
import flask
local = threading.local()
View s3_flask_python.py
```python
import threading
import boto3
import flask
local = threading.local()
View benchmark.py
import timeit
def test(setup, build, serialize, deserialize, number, entries, name):
print('Testing {}: '.format(name))
build = build.format(n=entries)
build_times = timeit.repeat(repeat=1, number=number, stmt=build, setup=setup)
print('{:<20} {:>6} ms'.format('build datastructure:', int(min(build_times) * 1000)))
setup = setup + build
serialize_times = timeit.repeat(repeat=1, number=number, stmt=serialize, setup=setup)
print('{:<20} {:>6} ms'.format('serialize:', int(min(serialize_times) * 1000)))
View buffers_benchmark.py
import timeit
def test(setup, build, serialize, deserialize, number, entries, name):
build = build.format(n=entries)
build_times = timeit.repeat(repeat=1, number=number, stmt=build, setup=setup)
print('{:<20} {:>5} ms'.format('build datastructure:', int(min(build_times) * 1000)))
setup = setup + build
serialize_times = timeit.repeat(repeat=1, number=number, stmt=serialize, setup=setup)
print('{:<20} {:>5} ms'.format('serialize:', int(min(serialize_times) * 1000)))
setup = setup + serialize
View build_clerk_feed.php
<?php
require_once 'abstract.php';
class Mage_Shell_Clerk extends Mage_Shell_Abstract {
public function run() {
set_time_limit(0);
$clerk_feed = Mage::getModel('clerk/feed');
$clerk_feed->buildFeeds();
You can’t perform that action at this time.