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 / geemap_err.MD
Last active October 30, 2020 07:58
Lỗi cài geemap

Cách cài Google Earth Engine python

module load python/3.6.2_gnu_64
module load openssl/1.1.1h_gnu_64

virtualenv gee_env
source gee_env/bin/activate

pip install geemap
@soiqualang
soiqualang / Bất đồng bộ trong JavaScript.MD
Created October 28, 2020 08:06
Bất đồng bộ trong JavaScript

Bất đồng bộ trong JavaScript

doit().then(function() { log('Now finally done!') });
log('---- But notice where this ends up!');

// For pedagogical reasons I originally wrote the following doit()-function so that 
// it was clear that it is a promise. That way wasn't really a normal way to do 
// it though, and therefore Slikts edited my answer. I therefore now want to remind 
// you here that the return value of the following function is a promise, because 
@soiqualang
soiqualang / configPHP.MD
Last active December 3, 2020 03:25
Note config PHP

Note config PHP

trong file php.init

set_time_limit(300); // Time in seconds, max_execution_time
set_time_limit(0); // Unlimited

trực tiếp trong file php

@soiqualang
soiqualang / PostgreSQL string to array.MD
Created October 13, 2020 03:45
PostgreSQL xử lý chuỗi thành mảng | PostgreSQL string to array

PostgreSQL xử lý chuỗi thành mảng | PostgreSQL string to array

-- SELECT POSITION(',' in 'ấp 2, Xã Thuận Hòa, Huyện Long Mỹ');


SELECT (string_to_array('ấp 2, Xã Thuận Hòa, Huyện Long Mỹ',','))[2];


SELECT array_length(string_to_array('ấp 2, Xã Thuận Hòa, Huyện Long Mỹ',','),1);
@soiqualang
soiqualang / Compare Speed of PostgreSQL Table - View - materialized Views.MD
Last active October 13, 2020 03:46
Compare Speed of PostgreSQL Table, View, materialized Views

Compare Speed of PostgreSQL Table, View, materialized Views

Make view

View

Create view ds_baiviet as
SELECT maso,tieude,nhom,luotxem,ngaycapnhat FROM "baiviet";
@soiqualang
soiqualang / postgresql_err_list.MD
Created September 22, 2020 08:30
List common err in PostgreSQL
@soiqualang
soiqualang / VSCode_Theme_config.MD
Last active September 11, 2020 02:25
Config glow theme visual code
@soiqualang
soiqualang / PostgreSQL CASE … END with multiple conditions.md
Created September 1, 2020 07:07
PostgreSQL CASE … END with multiple conditions

PostgreSQL CASE … END with multiple conditions

SELECT
 *,
 CASE
  WHEN (pvc IS NULL OR pvc = '') AND (datepose < 1980) THEN '01'
  WHEN (pvc IS NULL OR pvc = '') AND (datepose >= 1980) THEN '02'
  WHEN (pvc IS NULL OR pvc = '') AND (datepose IS NULL OR datepose = 0) THEN '03'
 ELSE '00'
@soiqualang
soiqualang / pug-bomb.php
Created August 28, 2020 07:14 — forked from retgef/pug-bomb.php
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{