Skip to content

Instantly share code, notes, and snippets.

@vishcious
vishcious / 001_create_index.js
Created November 9, 2018 19:28
bootstrapping mongodb with indexes and seed data for integration test
db = new Mongo().getDB("XXX");
db.getCollection('YYY').createIndex({ pid: 1 }, { name: 'AAA' })
db.getCollection('YYY').createIndex({ v: 1 }, { name: 'BBB' })
db.getCollection('ZZZ').createIndex({ as: 1 }, { name: 'CCC' })
@vishcious
vishcious / swagger.json
Created June 26, 2018 22:06
NiFi Registry 0.2.0 Swagger spec
{
"swagger" : "2.0",
"info" : {
"description" : "The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components.",
"version" : "0.2.0",
"title" : "NiFi Registry REST API",
"contact" : {
"name" : "Apache NiFi Registry",
"url" : "https://nifi.apache.org",
"email" : "[email protected]"
@vishcious
vishcious / NiFi 1.6.0 Swagger API
Created June 25, 2018 18:21
NiFi 1.6.0 Swagger API
{
"swagger" : "2.0",
"info" : {
"description" : "The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and \n stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description,\n definitions of the expected input and output, potential response codes, and the authorizations required\n to invoke each service.",
"version" : "1.6.0",
"title" : "NiFi Rest Api",
"contact" : {
"url" : "https://nifi.apache.org",
"email" : "[email protected]"
},
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@vishcious
vishcious / logback.xml
Created May 29, 2018 21:33
apache nifi minimal config
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %level [%thread] %logger{40} %msg%n</pattern>
</encoder>
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href='http://swagger.wordnik.com'>http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key 'special-key' to test the authorization filters",
"version": "1.0.0",
"title": "Petstore API",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
@vishcious
vishcious / Error with rio info command
Created December 6, 2016 22:31
Errors accessing S3 files with rasterio
AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXX rio -vvv info s3://utwrap-lambdastats/foa_UT.tif
DEBUG:rasterio.env:Environment <rasterio._drivers.GDALEnv object at 0x7f2cc9fe9360> exists
DEBUG:rasterio.env:Got a copy of environment <rasterio._drivers.GDALEnv object at 0x7f2cc9fe9360> options
DEBUG:rasterio._drivers:Set option CPL_DEBUG=True in env <rasterio._drivers.GDALEnv object at 0x7f2cc9fe9360>
DEBUG:rasterio.env:Updated existing <rasterio._drivers.GDALEnv object at 0x7f2cc9fe9360> with options {'CPL_DEBUG': True}
DEBUG:rasterio.env:Entering env <rasterio.env.Env object at 0x7f2cc426ec90> context
DEBUG:rasterio.env:Environment <rasterio._drivers.GDALEnv object at 0x7f2cc9fe9360> exists
DEBUG:botocore.credentials:Looking for credentials via: env
INFO:botocore.credentials:Found credentials in environment variables.
DEBUG:rasterio.env:Environment <rasterio._drivers.GDALEnv object at 0x7f2cc9fe9360> exists
@vishcious
vishcious / Domain Model
Created May 9, 2015 05:29
F# Designing with Types
namespace Zoo
open System
open System.Web
open System.Web.Http
open System.Web.Http.Tracing
open System.Net.Http
open System.Net
open System.Data.SQLite
open System.Configuration
@vishcious
vishcious / build.fsx
Created May 6, 2015 15:08
FAKE build setup with external build properties file setup
#r "./FAKE/tools/FakeLib.dll"
#r "System.Xml"
#load "initializeProperties.fsx"
open InitializeProperties
open Fake
open System
open System.IO
open System.Configuration
open System.Xml
@vishcious
vishcious / DrawFeatureEx
Created October 21, 2011 18:35
OpenLayers DrawFeature Control tweaked to support undo & redo
OpenLayers.Control.NewDrawFeatureEx = OpenLayers.Class(OpenLayers.Control.DrawFeature, {
initialize: function (layer, handler, options) {
OpenLayers.Control.DrawFeature.prototype.initialize.apply(this, [layer, handler, options]);
// configure the keyboard handler
this.keyboardCallbacks = {
keydown: this.handleKeyDown
};
this.keyboardHandler = new OpenLayers.Handler.Keyboard(this, this.keyboardCallbacks, {});
},