This file contains 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
# Copyright 2011 10gen | |
# | |
# Modified by Antonin Amand <[email protected]> to work with gevent. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains 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 boto.utils import parse_ts | |
from django.core.files.storage import get_storage_class | |
from storages.backends.s3boto import S3BotoStorage | |
""" | |
make sure you have this setting | |
AWS_PRELOAD_METADATA = True | |
and that you have python-dateutils==1.5 installed | |
""" |
This file contains 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
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
from django.views import generic | |
from django.http import HttpResponse | |
class JsonView(generic.View): | |
""" |
This file contains 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 bash | |
# set terminal to UTF8 (otherwise `gem install foreman` fails) | |
export LANG=en_CA.UTF-8 | |
# set up ruby env | |
mkdir ruby-gems | |
echo $HOME | |
echo `pwd` | |
export GEM_HOME=$HOME/.ruby-gems |
This file contains 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 locust import Locust, TaskSet, task | |
import old_client | |
old_client.patch() | |
class MyTasks(TaskSet): | |
@task | |
def index(self): | |
self.client.get("/") |
This file contains 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
sudo apt-get update | |
sudo apt-get install -y python-pip | |
sudo apt-get install -y python-dev | |
sudo apt-get install -y libzmq-dev | |
sudo pip install virtualenv | |
virtualenv venv | |
source venv/bin/activate | |
pip install locustio | |
pip install pyzmq |
This file contains 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 django.http import HttpResponse | |
from django.views import generic | |
class TemplateView(generic.TemplateView): | |
""" | |
Exactly like Django's TemplateView, but adds support for returning an | |
HttpResponse in get_context_data | |
""" | |
def get(self, request, *args, **kwargs): | |
context_or_response = self.get_context_data(**kwargs) |
This file contains 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
{ | |
"type": "MultiPolygon", | |
"coordinates": [ | |
[ | |
[ | |
[ | |
23.699980096133004, | |
35.70500438083553 | |
], | |
[ |
This file contains 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
#!/bin/bash | |
touch /tmp/Recent.xyz | |
while true | |
do | |
echo "Checking again..." | |
wget -q https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/InRelease -O /tmp/InRelease.xyz | |
if test /tmp/InRelease.xyz -nt Recent.xyz; then | |
say Docker timestamp updated! |
This file contains 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
// jonatans superconfig | |
net_graph 1 | |
//muzzleflash_light 0 | |
cl_forcepreload 1 | |
rate "128000" | |
cl_updaterate 128 | |
cl_cmdrate 128 | |
// crosshair |
OlderNewer