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 / calc1.sh
Created May 11, 2021 05:05
Linux bash shell addition, subtraction, multiplication and division
#!/bin/bash
# read -s -p "Enter Password: " pswd
read -p "Enter Num 1: " num1
read -p "Enter Num 2: " num2
# Phép cộng
kq=$(($num1 + $num2))
echo "Kết quả phép cộng:" $kq
# Phép trừ
kq=$(($num1 - $num2))
@soiqualang
soiqualang / osgeo_compile.sh
Created April 29, 2021 08:48 — forked from robinkraft/osgeo_compile.sh
compile and install GEOS, PROJ4 and GDAL from source on Ubuntu 12.0.4
# 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 April 16, 2021 09:51 — forked from korakot/selenium.py
Use selenium in Colab
# 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')

HTML table

Chỉnh width="200px" lại kích thước mong muốn Chỉnh path ảnh 1path ảnh 2 đến ảnh muốn chèn

<table >
	<tbody>
 
@soiqualang
soiqualang / Get feature info for each layer - L.TileLayer.BetterWMS.MD
Created April 8, 2021 02:19
Get feature info for each layer - L.TileLayer.BetterWMS.js

Get feature info for each layer - L.TileLayer.BetterWMS.js

showGetFeatureInfo: function(err, latlng, content){
    // alert(this.wmsParams.layers);
    var lyr=this.wmsParams.layers;
    if(lyr=='sinhthai:rung_1980' || lyr=='sinhthai:rung_1990' || lyr=='sinhthai:rung_2000' || lyr=='sinhthai:rung_2010' || lyr=='sinhthai:rung_2018'){
      var res_obj = JSON.parse(content);
      var code=res_obj.features[0].properties.PALETTE_INDEX;
      // raster2info(code,this.wmsParams.layers);
@soiqualang
soiqualang / GEE - Extract value from image.js
Last active March 12, 2021 04:12
GEE - Extract value from image
var img = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318');
var dem = ee.Image('USGS/SRTMGL1_003');
var arr1 = ee.FeatureCollection(ee.List([]));
var xy = ee.Geometry.Point([86.9250, 27.9881]);
var p1 = ee.Geometry.Point([142.36083984375, -37.466138602344046])
var p2 = ee.Geometry.Point([143.23974609375, -37.04640889969956])
var pts = ee.FeatureCollection(ee.List([ee.Feature(p1),ee.Feature(p2)]))
@soiqualang
soiqualang / dirname-filename-basename.bat
Created March 5, 2021 08:04 — forked from Ciantic/dirname-filename-basename.bat
How to get filename, dirname, and basename in 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 January 27, 2021 07:40 — 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.
<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 / netcdf2shape.MD
Created January 13, 2021 07:23
netcdf to shape

netcdf to shape

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from netCDF4 import Dataset
from osgeo import ogr,osr
from shapely import geometry
import os
@soiqualang
soiqualang / sketch-underline-style.md
Last active December 29, 2020 07:07
sketch-underline style

.sketch-underline

.sketch-underline {
    # background: url(https://www.monicahq.com/img/sketch_underline.svg) 0 100% no-repeat;
    background: url(https://raw.githubusercontent.com/gist/soiqualang/f90714627f4ad186c47a974720fafb3c/raw/17f56b29fef699eee952959aeb9f57554aba762d/sketch_underline.svg) 0 100% no-repeat;
    background-size: 100% .75rem;
    padding-bottom: .6rem;
}