Skip to content

Instantly share code, notes, and snippets.

View whatnick's full-sized avatar

Tisham Dhar whatnick

View GitHub Profile
@whatnick
whatnick / orchestrate.py
Created August 10, 2020 00:33
Use datacube-core, datacube-ows, datacube-explorer in one large script
import json
import logging
import os
from datetime import date, datetime, timedelta
from functools import partial
from hashlib import md5
from pathlib import PurePath
from time import sleep
import boto3
@whatnick
whatnick / DS1682_DeepSleep.ino
Created May 8, 2017 15:35
DS1682+ESP8266 based pulse counter with deepsleep
#include <Wire.h>
/* Comment this out to disable prints and save space */
//#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define DS1682_ADDR 0x6B
#define EVENT_COUNTER 0x09
@whatnick
whatnick / profile.svg
Created July 20, 2020 03:11
OWS Profile with Py-Spy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whatnick
whatnick / CMakeCache.txt
Last active June 30, 2020 07:37
QGIS Osgeo4w64 + Msys2 CMakeCache.txt
# This is the CMakeCache file.
# For build in directory: d:/QGIS/build
# It was generated by CMake: C:/Program Files/CMake/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
@whatnick
whatnick / cognito_auth.py
Created April 7, 2020 22:36
WIP Cognito Authentication for Airflow
# -*- coding: 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
#
@whatnick
whatnick / pydrive-dance.py
Created June 13, 2019 12:53
Integration between PyDrive and Flask-Dance
oauth_token = session['google_oauth_token']
from oauth2client.client import OAuth2Credentials
from datetime import datetime
expirty_str = str(datetime.fromtimestamp(oauth_token['expires_at']))
with flask_app.app_context():
token_data = {
'access_token' : oauth_token['access_token'],
'token_expiry' : expirty_str,
'user_agent' : 'PyDrive Automation',
'refresh_token' : None,
@whatnick
whatnick / ATM90E36_Basic_ESP32.ino
Created March 29, 2020 00:01
ESP32 ATm90E36 Basic code
/* ATM90E36 Energy Monitor Demo Application
The MIT License (MIT)
Copyright (c) 2016 whatnick and Ryzee
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.3.2, py-1.8.0, pluggy-0.13.1
rootdir: /home/ubuntu/eo-datasets, inifile: setup.cfg, testpaths: eodatasets3, tests
plugins: flake8-1.0.4, cov-2.8.1, hypothesis-4.54.0
collected 94 items
eodatasets3/documents.py .... [ 4%]
eodatasets3/images.py ... [ 7%]
eodatasets3/properties.py .. [ 9%]
eodatasets3/ui.py . [ 10%]
@whatnick
whatnick / gist:51858ca74d4a6338a03b9eaba12422ef
Last active December 3, 2019 11:08
OpenOCD output for sending bitstream to ECP5 part
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 25000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Warn : Transport "jtag" was already selected
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 25000 kHz
@whatnick
whatnick / lod_load.ms
Created September 14, 2015 06:13
MAXScript to load LoD's for use in Unreal Engine
pluginManager.loadClass FbxImporter
findDir = getDir #import + @"\"
rootDir = getSavePath initialDir:findDir
tileDirs = GetDirectories (rootDir+"\\Tile*")
for theDir in tileDirs do
(
print theDir
--theDirStrg = theDir + "\\*.fbx"
--theFiles = getFiles theDirStrg