This repo's location has changed.
This file contains hidden or 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
| """ | |
| This utility addresses the InegrityError that occurs when you try to add a new record to | |
| (probably a recently ported) postgres database while using Django, here's more . . . | |
| duplicate key value violates unique constraint "<app>_<table>_pkey" | |
| DETAIL: Key (id)=(2) already exists. | |
| The problem here is that the Postgres sequence generators are out of sync with your data. | |
| Here's a good overview: http://www.vlent.nl/weblog/2011/05/06/integrityerror-duplicate-key-value-violates-unique-constraint/ |
This file contains hidden or 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
| # Note (November 2016): | |
| # This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information | |
| # Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name yourserver.com; | |
| root /path/to/your/htdocs; |
This file contains hidden or 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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains hidden or 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
| { | |
| "directory": "components" | |
| } |
This file contains hidden or 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/sh | |
| if [ $(git diff HEAD@{1} HEAD --name-only | grep 'requirements/development.txt' -c) -ne 0 ] | |
| then | |
| sudo $VIRTUAL_ENV/bin/pip install -r /vagrant/myproject/requirements/development.txt | |
| fi | |
| compass compile /vagrant/myproject/myproject/static_media/stylesheets -e production --force | |
| $VIRTUAL_ENV/bin/python /vagrant/myproject/manage.py syncdb |
This file contains hidden or 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
| /** | |
| * Takes a camel cased identifier name and returns an underscore separated | |
| * name | |
| * | |
| * Example: | |
| * camelToUnderscores("thisIsA1Test") == "this_is_a_1_test" | |
| */ | |
| def camelToUnderscores(name: String) = "[A-Z\\d]".r.replaceAllIn(name, {m => | |
| "_" + m.group(0).toLowerCase() | |
| }) |
This file contains hidden or 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
| # if running bash | |
| if [ -n "$BASH_VERSION" ]; then | |
| # include .bashrc if it exists | |
| if [ -f "$HOME/.bashrc" ]; then | |
| . "$HOME/.bashrc" | |
| fi | |
| fi |
This file contains hidden or 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
| --- | |
| #### | |
| #### THIS IS OLD AND OUTDATED | |
| #### LIKE, ANSIBLE 1.0 OLD. | |
| #### | |
| #### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
| #### | |
| #### IF IT BREAKS I'M JUST SOME GUY WITH | |
| #### A DOG, OK, SORRY | |
| #### |
This file contains hidden or 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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |