Skip to content

Instantly share code, notes, and snippets.

View quangpd's full-sized avatar
💭
I may be slow to respond.

Pham Quang quangpd

💭
I may be slow to respond.
View GitHub Profile
https://stackoverflow.com/questions/49991444/create-a-rounded-button-button-with-border-radius-in-flutter?rq=1
Since, the left sides buttons are now deprecated, use the right sided ones.
Deprecated --> Recommended
RaisedButton --> ElevatedButton
OutlineButton --> OutlinedButton
FlatButton --> TextButton
ElevatedButton
Using StadiumBorder
{
"Stateless Widget": {
"prefix": "statelessW",
"body": [
"class ${1:name} extends StatelessWidget {",
" // const ${1:name}({Key key}) : super(key: key);\n",
" @override",
" Widget build(BuildContext context) {",
" return Container();",
" }",
cd /var/lib/dpkg/updates
rm -r ./*
------------
rm -r -f /var/lib/dpkg/updates/*
@quangpd
quangpd / gist:16a892381d5846f0edb8ecc269cc95c4
Last active November 22, 2020 16:55 — forked from donnierayjones/LICENSE
Render Bootstrap as "small" layout when printing
@media print {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
@quangpd
quangpd / comma_input_keyup.js
Last active October 24, 2023 14:07
Add comma/dot to number input on keyup event
$('input.number').val(function(index, value) {
return value
.replace(/\D/g, "")
.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
;
}).keyup(function(event) {
// skip for arrow keys
if(event.which >= 37 && event.which <= 40) return;
// format number
$(this).val(function(index, value) {
ALTER TABLE articles
ADD COLUMN `position` int(11) unsigned NOT NULL DEFAULT '0',
ADD COLUMN `status` int(1) unsigned NOT NULL DEFAULT '1',
ADD COLUMN `created_at` datetime NULL,
ADD COLUMN `created_by` int(11) unsigned NOT NULL DEFAULT '0',
ADD COLUMN `updated_at` datetime NULL,
ADD COLUMN `updated_by` int(11) unsigned NOT NULL DEFAULT '0',
ADD COLUMN `deleted` tinyint(1) NOT NULL DEFAULT '0',
ADD COLUMN `deleted_at` datetime NULL,
ADD COLUMN `deleted_by` int(11) unsigned NOT NULL DEFAULT '0'
@quangpd
quangpd / unicodeTH2unicodeDS.php
Created January 20, 2020 17:31
Unicode Tổ hợp 2 Dựng sẵn
/**
* Unicode Tổ hợp 2 Dựng sẵn
* @param [type] $unicode_str [description]
* @return [type] [description]
*/
function unicodeTH2unicodeDS($unicode_str)
{
$unicode_str = preg_replace("/\x{0065}\x{0309}/u", "ẻ", $unicode_str); # ẻ
$unicode_str = preg_replace("/\x{0065}\x{0301}/u", "é", $unicode_str); # é
$unicode_str = preg_replace("/\x{0065}\x{0300}/u", "è", $unicode_str); # è
@quangpd
quangpd / Setup xampp multi PHP version
Created April 23, 2019 07:08
Setup xampp multi PHP version
1. Install XAMPP with the PHP Version you want to run mainly, e.g. PHP 7.2 => resides by default in Installpath\xampp\php
2. Copy other php Versions in Installpath\xampp\, eg PHP 5.4 in => Installpath\xampp\php5
If you are lazy like me, just grab the other php folder from old xampp installations, => beneficial since the used dlls are already in the right place
3 Make sure every php version on her own has a working php.ini.
use individual error logs per version:
error_log="D:\xampp\php5\logs\php_error_log"
error_log="D:\xampp\php\logs\php_error_log"
# Upgrade your server’s php installation from 5.5.x to 5.6.x on Ubuntu 14.04 LTS
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6 php5.6-cli php5.6-common php5.6-curl php5.6-dev php5.6-gd php5.6-intl php5.6-json php5.6-ldap php5.6-mbstring php5.6-mcrypt php5.6-memcache php5.6-memcached php5.6-mysql php5.6-pgsql php5.6-readline php5.6-sqlite php5.6-xml php5.6-xsl libzip4 php5.6-zip
sudo apt-get update && apt-get upgrade
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php5-compat
sudo apt-get update
Sub MergeSheets()
Const NHR = 1
Dim MWS As Worksheet
Dim AWS As Worksheet
Dim FAR As Long
Dim LR As Long
Set AWS = ActiveSheet