- Create
UNLOGGED
table. This reduces the amount of data written to persistent storage by up to 2x. - Set
WITH (autovacuum_enabled=false)
on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we neverDELETE
orUPDATE
the table). - Insert rows with
COPY FROM STDIN
. This is the fastest possible approach to insert rows into table. - Minimize the number of indexes in the table, since they slow down inserts. Usually an index
on
time timestamp with time zone
is enough. - Add
synchronous_commit = off
topostgresql.conf
. - Use table inheritance for fast removal of old data:
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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://stackoverflow.com/questions/5870188/does-flask-support-regular-expressions-in-its-url-routing | |
#Even though Armin beat me to the punch with an accepted answer I thought I'd show an abbreviated example of how I implemented a regex matcher in Flask just in case anyone wants a working example of how this could be done. | |
from flask import Flask | |
from werkzeug.routing import BaseConverter | |
app = Flask(__name__) | |
class RegexConverter(BaseConverter): | |
def __init__(self, url_map, *items): |
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
## ================= ## | |
## Personal aliases ## | |
## ================= ## | |
hosts="/etc/hosts" | |
# shortcuts for bash edition | |
alias bashreload='source ~/.bashrc' | |
alias bashedit='vim ~/.bashrc' | |
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 | |
# ================================================================= | |
# Steps to setup a new computer for web development based on ubuntu | |
# ================================================================= | |
# vars | |
downloads_dir=~/Downloads | |
chrome_file='google-chrome-stable_current_amd64.deb' | |
skype_file='skype-ubuntu-precise_4.3.0.37-1_i386.deb' |
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 | |
declare(strict_types = 1); | |
namespace Api\Request; | |
use Api\Request\Exception\DeserializationException; | |
use JMS\Serializer\Context; | |
use JMS\Serializer\Exception\RuntimeException; | |
use JMS\Serializer\GenericDeserializationVisitor; |
Various search databases and backends as alternatives to Elasticsearch.
- Sonic - github.com/valeriansaliou/sonic - lightweight & schema-less search backend
- Tantivy - github.com/quickwit-oss/tantivy - full-text search engine library inspired by Apache Lucene
- Toshi - github.com/toshi-search/Toshi - search engine built on top of Tantivy
- Bayard - github.com/mosuka/bayard - search engine built on top of Tantivy
- Meilisearch - github.com/meilisearch/meilisearch - fast and full-featured search engine