Skip to content

Instantly share code, notes, and snippets.

#FEDORA
$ sudo dnf install openssl-devel libffi-devel
env/bin/pip install cryptography
env/bin/pip install pyOpenSSL ndg-httpsclient pyasn1
# UBUNTU
$ sudo apt-get install build-essential libssl-dev libffi-dev python-dev
@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>
@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, \
# 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, \
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++) {
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
/*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",
@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"
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)