Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
from flask import jsonify | |
@app.route('/data/ideas') | |
def data_ideas(): | |
# query for the ideas - return oldest first, limit 10 | |
ideas = models.Idea.objects().order_by('+timestamp').limit(10) | |
if ideas: |
<?php if ( (is_home() && (!$paged || $paged ==1)) || is_page() || is_single() || is_category()) :?> | |
<meta name="googlebot" content="index,archive,follow,noodp" /> | |
<meta name="robots" content="all,index,follow" /> | |
<meta name="msnbot" content="all,index,follow" /> | |
<?php else : ?> | |
<meta name="googlebot" content="noindex,noarchive,follow,noodp" /> | |
<meta name="robots" content="noindex,follow" /> | |
<meta name="msnbot" content="noindex,follow" /> | |
<?php endif; ?> |
rand = (max =10, min = 0) -> | |
Math.floor(Math.random() * (max - min + 1)) + min | |
console.log rand() | |
console.log rand 100 | |
console.log 50, 10 |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
// Core variables and mixins | |
@import "variables"; | |
@import "mixins"; | |
// Reset | |
@import "normalize"; | |
@import "print"; | |
// Core CSS | |
@import "scaffolding"; |
#coding: utf-8 | |
from __future__ import unicode_literals | |
from faker.providers import BaseProvider | |
class Provider(BaseProvider): | |
formats = [ | |
"{{verb}} {{noun}}", | |
"{{verb}} for {{noun}}", | |
"{{verb}} and {{verb}} {{noun}} {{project_type}}", | |
"{{verb}} {{noun}} in {{location}}", |
This is a copy of https://github.com/Jay-Oh-eN/datasets
- http://rs.io/2014/05/29/list-of-data-sets.html
- http://archive.ics.uci.edu/ml/
- https://dreamtolearn.com/doc/2HDNJH3XJU6CVGKZ7SDM4MCSW
- https://news.ycombinator.com/item?id=7727474
- http://www.quora.com/Where-can-I-find-large-datasets-open-to-the-public
- http://www.quora.com/Data-Analysis/Whats-your-favorite-free-data-source
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
<?php | |
function fix_file($source) { | |
$problems = array( | |
"/(<trkpt.*)\/>/", | |
"/<\/trkseg>\s*<trkseg>/" | |
); | |
$fixes = array( | |
"$1></trkpt>", |