Skip to content

Instantly share code, notes, and snippets.

View suricactus's full-sized avatar
🌍

Ivan Ivanov suricactus

🌍
View GitHub Profile
import sys
from typing import List
reset_color = "\033[0m"
colors = [
"\033[91m", # red
"\033[92m", # green
"\033[93m", # yellow
"\033[94m", # blue
"\033[95m", # purple
@suricactus
suricactus / .vimrc
Last active December 10, 2022 19:53
" Automatically install vim-plug
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
" All plugs
call plug#begin()
" Reasonable defaults
@suricactus
suricactus / BuildingPCRasterOnUbuntu.md
Last active April 5, 2022 06:30 — forked from timlinux/BuildingPCRasterOnFedora.md
Building PCRaster on Ubuntu

What follows are the steps I took to build PCRaster on Fedora (34) from source. I chose to build from source because I didn't want to use the conda installer and I could not find a stand alone package.

The process below assumes that you have a working QGIS build environment since some of the PCRaster dependencies are provided by the QGIS dependency tree too.

git clone git@github.com:pcraster/pcraster.git
#!/usr/bin/env python3
import tensorflow as tf
with tf.device('/gpu:0'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
with tf.Session() as sess:
from typing import (Union, Dict, Any)
import numpy as np
import pandas as pd
import geopandas as gpd
from geopandas.geodataframe import GeoDataFrame
import rasterio
import rasterio.features
from rasterio.io import DatasetWriter
@suricactus
suricactus / README.md
Last active May 29, 2020 13:49
OpenLISEM maps creation, Windows
  1. Please setup all the needed gdal and pcraster tools in your PATH
  2. Make sure you follow the file structure:

-- soils -- DEM -- roads -- scripts -- ....

  1. IMPORTANT: find your ldd value yourself and change all the environment variables!!!
@suricactus
suricactus / kampala.sh
Last active October 11, 2018 15:45
Lisem scripts
#!/bin/bash -e
./scripts/lisem_mask_prepare.sh --resolution 20 DEM/kampala_demARCs1.tif 19887 --cleanup
./scripts/lisem_resample.sh landuse2016/frBU2016.tif mask20m.map build20m.map
./scripts/lisem_resample.sh landuse2016/frSOIL2016.tif mask20m.map bare20m.map
./scripts/lisem_resample.sh landuse2016/frVEG2016.tif mask20m.map veg20m.map
./scripts/lisem_resample.sh soils/bulkdens_sl2r.tif mask20m.map bulkdens_sl2r.map
#!/bin/bash
### To work properly, run this script as root
# path where the script to be installed
INSTALL_PATH=/opt
INSTALL_DIR=pcraster
# actual script, see http://pcraster.geo.uu.nl/getting-started/pcraster-on-linux/
cd $INSTALL_PATH
@suricactus
suricactus / .eslintrc
Last active July 5, 2018 19:25
eslintrc
{
"extends": ["eslint:recommended", "semistandard-react"],
"rules": {
"comma-dangle": ["error", "always-multiline"],
"jsx-quotes": ["error", "prefer-double"],
"max-depth": ["error", 4],
"max-params": ["error", 3],
"max-depth": ["error", 4],
"max-nested-callbacks": ["error", 3],
"complexity": ["warn", 20],
{
"color_scheme": "Packages/User/SublimeLinter/base16-ocean.dark (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"font_size": 10,
"ignored_packages":
[
],
"index_exclude_patterns":
[