Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
hihihaha

soiqualang

🙃
hihihaha
View GitHub Profile
@soiqualang
soiqualang / README.md
Created Aug 15, 2021 — forked from FMCorz/README.md
Adminer with SQLite no-login
View README.md

Adminer setup

Enables plugins, and SQLite no-login.

Instructions

  1. Copy index.php to a new directory
  2. Download Adminer to adminer.php
@soiqualang
soiqualang / postgis2shp.py
Created Aug 6, 2021 — forked from justinlewis/postgis2shp.py
A simple script for converting PostGIS tables to shapefiles with ogr2ogr.
View postgis2shp.py
#### Author: Justin Lewis
#### This script can be used to export a single pg table to shapefile.
####
#### Developed in a linux environment but should require minimal modification to run on other platforms.
####
#### Dependancies:
###### fwtools (gdal > ogr2ogr), PostGIS database, Python, PyGreSQL
import os, _pg
View docker-on-android.md

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@soiqualang
soiqualang / osgeo_compile.sh
Created Apr 29, 2021 — forked from robinkraft/osgeo_compile.sh
compile and install GEOS, PROJ4 and GDAL from source on Ubuntu 12.0.4
View osgeo_compile.sh
# Compile/install GEOS. Taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GEOS_2
cd /tmp
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
bunzip2 geos-3.4.2.tar.bz2
tar xvf geos-3.4.2.tar
cd geos-3.4.2
@soiqualang
soiqualang / selenium.py
Created Apr 16, 2021 — forked from korakot/selenium.py
Use selenium in Colab
View selenium.py
# install chromium, its driver, and selenium
!apt update
!apt install chromium-chromedriver
!pip install selenium
# set options to be headless, ..
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
@soiqualang
soiqualang / dirname-filename-basename.bat
Created Mar 5, 2021 — forked from Ciantic/dirname-filename-basename.bat
How to get filename, dirname, and basename in bat?
View dirname-filename-basename.bat
set filepath="C:\some path\having spaces.txt"
for /F "delims=" %%i in (%filepath%) do set dirname="%%~dpi"
for /F "delims=" %%i in (%filepath%) do set filename="%%~nxi"
for /F "delims=" %%i in (%filepath%) do set basename="%%~ni"
echo %dirname%
echo %filename%
echo %basename%
@soiqualang
soiqualang / HTML Application.hta
Created Jan 27, 2021 — forked from drewchapin/HTML Application.hta
Template for an HTML Application file (.hta), add to C:\Windows\ShellNew, and add ShellNew\Filename="HTML Application.hta" to .hta HKCR key.
View HTML Application.hta
<html>
<head>
<!--
@tag hta:application
@attribute ApplicationName Sets the name of the HTA.
@attribute Border [Thick]|Thin|None
@attribute BorderStyle [Normal]|Raised|Sunken|Complex|Static
@attribute Caption [Yes]|No
@soiqualang
soiqualang / xyz_vs_tms.md
Created Dec 4, 2020 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them
View xyz_vs_tms.md

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

View GitDeleteCommands.ps1
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch
@soiqualang
soiqualang / wfs_download.py
Created Nov 23, 2020 — forked from trolleway/wfs_download.py
mass download vector data from WFS service. Generates a sh script with ogr2ogr calls.
View wfs_download.py
from owslib.fes import *
from owslib.etree import etree
from owslib.wfs import WebFeatureService
wfs11 = WebFeatureService(url='http://example.com:8080/geoserver/wfs/', version='1.1.0')
f = open('download.sh', 'wb')
f.write('#!/bin/bash'+'\n')
f.write(''+'\n')