Skip to content

Instantly share code, notes, and snippets.

View naoliv's full-sized avatar
:electron:
Writing ugly code

Nelson A. de Oliveira naoliv

:electron:
Writing ugly code
View GitHub Profile
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
try:
from bdateutil import rrule, BDAILY
except:
sys.exit('Necessário instalar bdateutil\n→ pip install --upgrade https://github.com/segfault/python-bdateutil/tarball/master')
diff --git a/data/defaultpresets.xml b/data/defaultpresets.xml
index 23224ac46..b88f3d9d4 100644
--- a/data/defaultpresets.xml
+++ b/data/defaultpresets.xml
@@ -664,7 +664,6 @@
de.href="https://wiki.openstreetmap.org/wiki/DE:Link_(highway)"
fr.href="https://wiki.openstreetmap.org/wiki/FR:Link_(highway)"
it.href="https://wiki.openstreetmap.org/wiki/IT:Link_(highway)"
- pt_BR.href="https://wiki.openstreetmap.org/wiki/Pt-br:Link_(highway)"
ru.href="https://wiki.openstreetmap.org/wiki/RU:Link_(highway)"
@naoliv
naoliv / landuse.validator.mapcss
Created February 5, 2018 12:11
Validation rule for landuse inside landuse (including relations)
area[tag("landuse") = parent_tag("landuse")] ∈ area[landuse] {
throwWarning: tr("{0} inside {1}", concat("landuse=", tag("landuse")), concat("landuse=", tag("landuse")));
}
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Municipios" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Municipios">
<xs:complexType>
<xs:sequence>
<xs:element name="cod_id" type="xs:int" />
/* em azul pontos de ônibus que já existem e não foram modificados */
node|z15-[public_transport = platform]!:modified {
icon-image: none;
symbol-shape: octagon;
symbol-size: 15;
symbol-fill-color: blue;
}
/* em laranja pontos de ônibus utilizando o padrão antigo (atualizar, se possível) */
node|z15-[highway = bus_stop] {
{
"coordinates": [
[ -46.637365, -23.5476397 ],
[ -46.524459, -23.4430602 ],
[ -47.06083, -22.90556 ],
[ -46.5629624, -23.6901021 ],
[ -46.5322504, -23.6573395 ],
[ -46.7916801, -23.5324859 ],
[ -45.8906617, -23.1806359 ],
[ -47.8066671, -21.178333 ],
{
"coordinates": [
[ -67.8220778, -9.9765362 ],
[ -72.6703869, -7.6307956 ],
[ -68.6571058, -9.0659556 ],
[ -35.7339264, -9.6476843 ],
[ -36.661471, -9.754866 ],
[ -35.839435, -9.477829 ],
[ -59.9865291, -3.1328619 ],
[ -56.7319324, -2.6344567 ],
{"durations":[[0,1173,3844,1132,1217,1214,4221,11998,4040,1734,17304,3460,2830,1153,2484,1450,6111,12916,3330,1828,15420,4465,5251,3557,5783,2346,1210,4526,1522,1648,9431,17562,4221,1729,5153,3606,11147,2013,21917,4356,6990,20072,5124,2003,2792,1962,4024,4074,5998,943,6813,6573,2309,12295,8882,3103,6608,2739,1988,2095,3635,12907,15542,17230,7361,1781,19600,4324,5613,2449,4436,2166,9162,3635,14269,16658,7268,4774,5083,1878,12768,1839,7358,20852,4816,8705,10269,7905,3155,10599,1821,10442,12294,9067,2780,15495,3707,16798,14260,8098],[1287,0,4515,1970,1898,1884,3846,12668,4710,2321,17974,4298,2508,2141,3154,2120,6781,13587,4168,1507,16090,5303,4929,4395,6453,2024,2270,5196,2192,2708,10101,18232,4892,2789,5824,3267,11817,2684,22587,5027,7660,20743,5795,1844,3162,3022,4694,3638,5676,1649,7483,7150,2424,12965,9553,2667,7278,3577,2658,2707,4306,13577,16212,17900,7039,2451,20270,4994,6283,3120,5106,1844,8840,4115,14939,17329,7938,5444,5921,2548,13438,1404,7935,21522,4484,9281,10940,7583,3949,10277,1447,10120,12964,874
{"durations":[[0,36678,8289,272951,267688,273080,103955,null,121935,265004,263637,285968,247002,242374,226171,284719,283920,271489,167607,224321,223042,222779,158340,158794,160853,245284,212423,246142,194248,166140,193644,139815,150899,158083,111980,111554,121762,218839,219361,159768,289581,287614,289843,284639,284400,285237,249140,262865,261050,185926,169429,167647,199905,201097,199203,296828,288130,296039,29989,51973,41279,147799,132135,141059,208173,209906,205724,191524,198500,195883,259083,259388,257668,182145,182789,181729,198745,211127,185201],[36804,0,28770,309572,304309,309702,140577,null,158557,301626,300259,322590,283624,278995,262793,321341,320541,308111,204228,260942,259664,259401,194962,195415,197474,281905,249045,282763,230869,202761,230265,176436,187521,194705,148602,148176,158384,255460,255982,196390,326202,324235,326465,321261,321021,321858,285762,299487,297671,222547,206050,204269,236527,237718,235825,333450,324751,332660,66610,88595,77900,184421,168757,177681,244794,246527,242346,228146,235
@naoliv
naoliv / place-transparente-style.mapcss
Created August 17, 2015 18:46
MapCSS para place=* transparente
area[place] {
fill-opacity: 0;
}