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
package main | |
import ( | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"os" | |
) | |
type msg struct { |
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 Container(PolymorphicModel, ShowFieldContent, Publishable, Channeling): | |
uid = models.CharField( | |
_(u'UID'), | |
max_length=60, | |
null=True, blank=True, | |
db_index=True | |
) | |
child_class = models.CharField( | |
_(u'Child class'), | |
max_length=30, |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5OfVvY6xmZdtw5pYJMECnfRfMm7zWMytg+IL9AyNhbu8UdBmGdT6wUiBBBw9CTcdnmDYj08n8gWXV6Jz2eazl7fC27HQr9BzJb35FM1LpnXncSDNxn5Itj89ROIgY70d2obp35K9+I+muFkAYuYJEHjtrGr7KIlC1oM+v+K43Jla4SotoBleLNbec0GwtyeYBB7bL9yhGhpEje+dtpLJFd5H/bDBuvjDg/tPHeAnflg0QfUeYfNDC44psY/uJQGBrob3eLcOdJSIV418JS+z1inC9Iljg+xkHGwWg3TSS2lD4ufZcKumBpc2S7T9XSVVB0KDeFTgyQHNDkCtG5xRb thiago@avelino.xxx |
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
(Pdb) self.__class__._meta.fields() | |
*** TypeError: 'list' object is not callable | |
(Pdb) self.__class__._meta.fields | |
[<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: date_insert>, <django.db.models.fields.DateTimeField: date_update>, <django.db.models.fields.related.ForeignKey: user>, <django.db.models.fields.related.ForeignKey: site>, <django.db.models.fields.PositiveIntegerField: site_uid>, <django.db.models.fields.CharField: site_domain>, <django.db.models.fields.DateTimeField: date_available>, <django.db.models.fields.BooleanField: published>, <django.db.models.fields.CharField: uid>, <django.db.models.fields.CharField: child_class>, <django.db.models.fields.CharField: child_module>, <django.db.models.fields.CharField: child_app_label>, <django.db.models.fields.related.OneToOneField: container_ptr>, <django.db.models.fields.SlugField: slug>, <django.db.models.fields.CharField: tags>, <django.db.models.fields.CharField: title>, <django.db.models.fields.CharField: hat>, <dja |
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 python | |
import multiprocessing | |
bind = "0.0.0.0:8080" | |
workers = multiprocessing.cpu_count() * 2 + 1 | |
worker_class = "gevent" |
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
<?php | |
if (!isset($_GET['id']) || !isset($_GET['gid'])) exit; | |
if(!function_exists('get_option')) { | |
$path = ( defined('ABSPATH') ? ABSPATH : dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/'); | |
require_once($path.'wp-blog-header.php'); | |
} | |
global $slidepress; | |
header("HTTP/1.1 200 OK"); | |
header("Status: 200 All rosy") ; | |
global $wpdb; |
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
obj = MyModel() | |
obj.first_name = "Thiago" | |
obj.last_name = "Avelino" | |
obj.save() | |
obj.pk = None | |
obj.save() |
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
# http://www.avelino.xxx/2015/01/go-vs-python-more-request-per-second | |
import falcon | |
import bjoern | |
class ThingsResource: | |
def on_get(self, req, resp): | |
resp.status = falcon.HTTP_200 | |
resp.body = ("Hello World") |
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
# http://www.avelino.xxx/2015/01/go-vs-python-more-request-per-second | |
$ ab -n10000 -c500 http://127.0.0.1:8080/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 1000 requests | |
Completed 2000 requests | |
Completed 3000 requests | |
Completed 4000 requests | |
Completed 5000 requests | |
Completed 6000 requests |
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 | |
echo "123" |