Skip to content

Instantly share code, notes, and snippets.

@yellow-sky
yellow-sky / trac2bitbucket.py
Created November 4, 2013 21:34
Trac Wiki to Bitbucket Wiki simple converter. Based on https://gist.github.com/sgk/1286682
#!/usr/bin/python
# coding=utf-8
import sqlite3
import re
import sys
from os import path, rename, walk, mkdir
import shutil
PAGE_QUERY = '''
select
wms_url = 'http://maps.rosreestr.ru/arcgis/services/Cadastre/CadastreWMS/MapServer/WMSServer?format=image/png&layers=1&styles=&crs=EPSG:3857'
layer = QgsRasterLayer('url=%s' % wms_url, 'Test WMS', 'wms')
if not layer.isValid():
QgsMessageLog.logMessage('ops', level=QgsMessageLog.CRITICAL)
else:
QgsMapLayerRegistry.instance().addMapLayer(layer)
@yellow-sky
yellow-sky / test_speed.py
Created June 17, 2015 23:12
block version
import gc
import numpy as np
import numpy.ma as ma
from osgeo import gdal
from osgeo.gdalconst import *
import time
import rasterio
f = "2014.05.09.tif"
/*global console, OpenLayers*/
define([
"dojo/_base/declare",
"webmap/tool/Base",
"dojo/_base/lang",
"dojo/_base/array",
"dojo/Deferred",
"dojo/promise/all",
"dojo/json",
"dojo/request/xhr",
define([
"dojo/_base/declare",
"dojo/_base/array",
"dojo/dom-class",
"dojo/on",
"dojox/image/Lightbox",
"put-selector/put",
"ngw/route",
"ngw-feature-layer/DisplayWidget",
// css
define([
"dojo/_base/declare",
"dojo/_base/array",
"dojo/dom-class",
"dojo/on",
"dojox/image/Lightbox",
"put-selector/put",
"ngw/route",
"ngw-feature-layer/DisplayWidget",
// css
layers = [zapros, zapros2];
var i;
i=2;
var n=0;
var all_datas = [];
var all_bh = [];
var all_data_sources = [];
var keys =[];
for (n=0; n<i; n++) {
# coding=utf-8
import types
from sqlalchemy import event, ForeignKey
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from nextgisweb import db
from nextgisweb.models import declarative_base
from nextgisweb.resource import Resource
from nextgisweb_compulink.compulink_admin.model import PROJECT_STATUSES, PROJECT_STATUS_PROJECT, Region, \
@yellow-sky
yellow-sky / model.py
Created December 10, 2015 14:07
decl_attr
# coding=utf-8
import types
from sqlalchemy import event, ForeignKey
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from nextgisweb import db
from nextgisweb.models import declarative_base
from nextgisweb.resource import Resource
from nextgisweb_compulink.compulink_admin.model import PROJECT_STATUSES, PROJECT_STATUS_PROJECT, Region, \
@yellow-sky
yellow-sky / f2
Last active December 3, 2016 13:37
Last Forest
###### Widget Code
<div id="treeCoverGainMapId" style="height: 400px; width: 100%">
<a target="_blank" href="https://bit.ly/2g3UnjN">
<div class="gfw-link leaflet-control"></div>
</a>
<div class="leaflet-bar chk-panel leaflet-bottom leaflet-left ">
<label class="chk-label leaflet-control "><input type="checkbox" id="chkShowLoss">Показать потери</label>
</div>
</div>