Skip to content

Instantly share code, notes, and snippets.

View soiqualang's full-sized avatar
🙃
hihihaha

Đỗ Thành Long soiqualang

🙃
hihihaha
View GitHub Profile
@soiqualang
soiqualang / Tiếng Việt trong VBA.md
Created December 10, 2020 10:22
Tiếng Việt trong VBA

Alt + F11

Sub Paste_OneCell()

    'Copy and Paste 1 Cell
    'Range("A1").Copy Range("B1")

    'Cut and Paste 1 Cell
    'Range("A1").Cut Range("B1")
@soiqualang
soiqualang / xyz_vs_tms.md
Created December 4, 2020 09:22 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them

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.

@soiqualang
soiqualang / GitDeleteCommands.ps1
Created December 2, 2020 15:57 — forked from cmatskas/GitDeleteCommands.ps1
Git Delete Branch commands
## 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 / WMS,WFS server - Whats another MapServer, GeoServer.MD
Last active November 24, 2020 07:49
WMS/WFS server | What's another MapServer, GeoServer?
@soiqualang
soiqualang / wfs_download.py
Created November 23, 2020 09:20 — forked from trolleway/wfs_download.py
mass download vector data from WFS service. Generates a sh script with ogr2ogr calls.
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')
@soiqualang
soiqualang / Max files per directory on NTFS vol vs FAT32.MD
Last active November 17, 2020 04:34
Max files per directory on NTFS vol vs FAT32

Max files per directory on NTFS vol vs FAT32

After a quick search on google I found these:

FAT32

  • Maximum disk size: 2 terabytes
  • Maximum file size: 4 gigabytes
  • Maximum number of files on disk: 268,435,437
  • Maximum number of files in a single folder: 65,534
@soiqualang
soiqualang / Zip file by command line.md
Last active November 16, 2020 08:21
Zip file by command line

Zip file by command line

Window

Install 7zip

7z a -tzip {yourfile.zip} {yourfolder}
7z a -tzip nongnghiep_vn.zip nongnghiep_vn.sql
@soiqualang
soiqualang / Change password postgresql.md
Created November 12, 2020 07:19
Change password postgresql

Change password postgresql

psql --help

Connection options:
  -h, --host=HOSTNAME      database server host or socket directory (default: "local socket")
  -p, --port=PORT          database server port (default: "5432")
  -U, --username=USERNAME  database user name (default: "ictla")
 -w, --no-password never prompt for password
@soiqualang
soiqualang / Get the position of a div,span tag.md
Created November 5, 2020 08:59
Get the position of a div/span tag

Get the position of a div/span tag

function getPos(el) {
    // yay readability
    for (var lx=0, ly=0;
         el != null;
         lx += el.offsetLeft, ly += el.offsetTop, el = el.offsetParent);
    return {x: lx,y: ly};
}