This example builds on Mike Bostock's D3 + Leaflet example, and fixes a clipping problem: if you zoom in and pan around, in the original example, the SVG is not big enough to cover the extent of the D3 layer, so the features get clipped. Here instead, we size the SVG to cover the entire world, -180 to 180 longitude and 90 to -90 latitude, and update its offset after zoom.
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/bash | |
| set -e | |
| PRJHOME='/home/mgax/zechat' | |
| source $PRJHOME/venv/bin/activate | |
| set -x | |
| echo "Deploying zechat:" | |
| cd $PRJHOME/zechat |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import simplejson as json; from path import path | |
| trim_5 = lambda v: float('%.5s' % v) | |
| l = json.loads(path(SRC_PATH).bytes().decode('latin-1')) | |
| for f in l['features']: | |
| f['properties'] = {'id': int(f['properties']['SIRUTA'])} | |
| f['geometry']['coordinates'] = map(trim_5, f['geometry']['coordinates']) | |
| path(DST_PATH).write_text(json.dumps(l)) |
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
| Nu da vrabia din mână pentru cioara de pe gard. | |
| Lumea muncește și sapă și eu duc câinii la apă. | |
| Caută o femeie care-ți place ție, nu la alții. | |
| A bate găina cu lanțul. | |
| Cine nu-ncearcă, nici nu câștigă. | |
| Cine fură azi un ou, mâine va fura un bou. | |
| Tinerii înaintea bătrânilor, să aibă urechi, nu gură! | |
| Nu e dracul așa de negru. | |
| Toate drumurile/căile duc la Roma. | |
| Cine seamănă vânt, culege furtună. |
-
mkdir -p /var/local/swap dd if=/dev/zero of=/var/local/swap/1 bs=1M count=256 mkswap /var/local/swap/1 chmod 600 /var/local/swap/1 swapon /var/local/swap/1 echo 10 > /proc/sys/vm/swappiness
echo "/var/local/swap/1 none swap sw 0 0" >> /etc/fstab
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/bash | |
| set -e | |
| set -x | |
| cd /data/project/osmose/backend | |
| sudo -u osmose ./osmose_run.py --country=romania $@ |
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/bash | |
| set -x | |
| exec /usr/bin/php-cgi -b $PORT -d fastcgi.logging=0 |
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
| SELECT pg_size_pretty(pg_total_relation_size('name')); | |
| SELECT pg_size_pretty(pg_database_size('name')); |
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
| #!/usr/bin/env python | |
| from datetime import date | |
| import subprocess | |
| DB_NAME = 'awesome' | |
| BACKUP_PATH = '/var/local/awesome/backup/awesome-%s.sql.gz' | |
| def main(): |
OlderNewer