Skip to content

Instantly share code, notes, and snippets.

@cuulee
cuulee / unet_inria_colab.ipynb
Created June 19, 2021 13:50
unet_inria_colab.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol clip_to_extent="1" name="qlimt" force_rhr="0" type="fill" alpha="1">
<layer enabled="1" pass="0" locked="0" class="GeometryGenerator">
<prop v="Fill" k="SymbolType"/>
<prop v="with_variable('my_geom',&#xd;&#xa;CASE WHEN &#xd;&#xa; num_geometries( $geometry)>1&#xd;&#xa; THEN &#xd;&#xa; geometry_n( $geometry, @geometry_part_num)&#xd;&#xa; ELSE&#xd;&#xa; $geometry&#xd;&#xa; END,&#xd;&#xa; with_variable('shape',rand(1,4),&#xd;&#xa; CASE WHEN &#xd;&#xa; @shape =1&#xd;&#xa; THEN &#xd;&#xa; minimal_circle( @my_geom )&#xd;&#xa; WHEN&#xd;&#xa; @shape =2&#xd;&#xa; THEN&#xd;&#xa; oriented_bbox( @my_geom )&#xd;&#xa; WHEN&#xd;&#xa; @shape =3&#xd;&#xa; THEN&#xd;&#xa; oriented_bbox( @my_geom )&#xd;&#xa; WHEN&#xd;&#xa; @shape =4&#xd;&#xa; THEN&#xd;&#xa; simplify(@my_geom, rand(1,20))&#xd;&#xa; END))&#xd;&#xa; " k="geometryModifier"/>
<data_defined_properties>
<Option type="Map">
@cuulee
cuulee / mapOrder.js
Created March 24, 2020 08:28 — forked from ecarter/mapOrder.js
Order an array of objects based on another array order
/**
* Sort array of objects based on another array
*/
function mapOrder (array, order, key) {
array.sort( function (a, b) {
var A = a[key], B = b[key];
@cuulee
cuulee / app.js
Created December 27, 2019 02:51 — forked from pantharshit00/app.js
Simple express app using JWT authentication
/**
* To get started install
* express bodyparser jsonwebtoken express-jwt
* via npm
* command :-
* npm install express bodyparser jsonwebtoken express-jwt --save
*/
// Bringing all the dependencies in
const express = require('express');
@cuulee
cuulee / cuml_taxi_fare_prediction.ipynb
Created December 18, 2019 00:39 — forked from gumdropsteve/cuml_taxi_fare_prediction.ipynb
cuML_Taxi_Fare_Prediction.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cuulee
cuulee / plot_missing_data.ipynb
Created November 23, 2019 14:27 — forked from martinfleis/plot_missing_data.ipynb
Support for missing data in Geopandas plotting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cuulee
cuulee / ensureMutationId.ts
Created August 21, 2019 06:10 — forked from bkonkle/ensureMutationId.ts
Ensure an '$id' for every Mutation in PostGraphile
export const ensureMutationId: Plugin = builder => {
builder.hook('GraphQLObjectType:fields:field', (field, build, context) => {
const {pgSql: sql} = build
const {
scope: {
isPgUpdateMutationField,
isPgCreateMutationField,
isPgDeleteMutationField,
},
} = context
@cuulee
cuulee / server.js
Created August 2, 2019 04:40 — forked from zimmicz/server.js
PostGIS MVT Express routing
const express = require("express")
const app = express()
const { Pool } = require("pg")
const SphericalMercator = require("sphericalmercator")
const pool = new Pool({
host: "localhost",
port: 15432,
user: "postgres",
database: "postgres"
})
@cuulee
cuulee / postgres-pivot.md
Created August 1, 2019 09:41 — forked from ryanguill/postgres-pivot.md
Example of postgres pivot using jsonb_object_agg for variable columns in output. To play with this yourself in an online repl, click here: http://dbfiddle.uk/?rdbms=postgres_9.6&fiddle=5dbbf7eadf0ed92f8d6a49fc5be8f3f2
/*
================================================================================
Pivot example with variable number of columns in the output.
================================================================================

example data is straight forward, imagine a table with a customer identifier, an invoice date and an amount.
*/

DROP TABLE IF EXISTS invoice;
@cuulee
cuulee / index.js
Created July 29, 2019 10:31 — forked from stepankuzmin/index.js
PostGIS ST_AsMVT JSONB properties encoding bug
const fs = require("fs");
const geobuf = require("geobuf");
const Protobuf = require("pbf");
const pgp = require("pg-promise")();
const vt = require("vector-tile");
const db = pgp(process.env.DATABASE_URL);
const tile_with_properties_as_jsonb = `WITH data AS (
SELECT * FROM (VALUES