python scripts/test_API.py 200 100
INFO: Starting timings by ranges of 200 calls on http://popshake.codegastudio.com/api, @2014-09-29T14:07:57.354054)
INFO: Results: 140/200 (70.0%) long calls for /; average others: 0.199sec
INFO: Results: 64/200 (32.0%) long calls for /moods/; average others: 0.223sec
INFO: Results: 84/200 (42.0%) long calls for /moods/1/; average others: 0.273sec
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
# coding=UTF-8 | |
import nltk | |
from nltk.corpus import brown | |
# This is a fast and simple noun phrase extractor (based on NLTK) | |
# Feel free to use it, just keep a link back to this post | |
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/ | |
# Create by Shlomi Babluki | |
# May, 2013 |
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
# -*- coding: utf-8 -*- | |
""" | |
Whoosh backend for haystack that implements character folding, as per | |
http://packages.python.org/Whoosh/stemming.html#character-folding . | |
Tested with Haystack 2.4.0 and Whooch 2.7.0 | |
To use, put this file on your path and add it to your haystack settings, eg. |
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 | |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0 | |
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
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
# -*- coding: utf-8 | |
""" | |
PostgreSQL backup script for Windows. | |
Olivier Cortès <[email protected]> 2014 | |
Licensed under the GNU GPL version 3. | |
https://gist.github.com/Karmak23/62872892dd49f04f58d2 | |
## Dependancies |
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
class WithoutNoneFieldsSerializer(serializers.ModelSerializer): | |
""" Exclude model fields which are ``None``. | |
This eventually includes foreign keys and other special fields. | |
Source: https://gist.github.com/Karmak23/5a40beb1e18da7a61cfc | |
""" | |
def to_native(self, obj): |
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
class DRFLoggerMixin(object): | |
""" | |
Allows us to log any incoming request and to know what's in it. | |
Usage: | |
class MyOwnViewSet(DRFLoggerMixin, | |
mixins.ListModelMixin, | |
… | |
viewsets.GenericViewSet): |
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
import types | |
from django import forms | |
class DynamicAttrsForm(forms.ModelForm): | |
class Meta: | |
model = models.DynamicAttrs | |
fields = ['template', 'mood', 'text' ] | |
I hereby claim:
- I am Karmak23 on github.
- I am karmak23 (https://keybase.io/karmak23) on keybase.
- I have a public key whose fingerprint is 64D9 3693 529E 7C96 4F2A ACA8 9530 77A9 A145 96A0
To claim this, I am signing this object:
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
ignorecase = true | |
precomposeunicode = false | |
[remote "origin"] | |
url = [email protected]:1flow | |
fetch = +refs/heads/*:refs/remotes/origin/* |
NewerOlder