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
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 / 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) {
@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%;
}
cd /var/lib/dpkg/updates
rm -r ./*
------------
rm -r -f /var/lib/dpkg/updates/*
{
"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();",
" }",
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Multiple Sheets</title>
<!-- Normalize or reset CSS with your favorite library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
@quangpd
quangpd / Routes.php
Created October 6, 2021 08:19
Disable routes check last foward slash on URI
system\Router\Router.php
Add $uri = rtrim($uri, '/');
Before $uri = urldecode($uri); // Line 141
@quangpd
quangpd / main.dart
Created November 12, 2021 16:41 — forked from eduardoflorence/main.dart
Getx - Sample Form
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
initialRoute: '/login',
getPages: [
GetPage(
name: '/login',
page: () => LoginPage(),
@quangpd
quangpd / PhpSpreadsheet - Disable Formula Cached
Created March 2, 2022 04:53
PhpSpreadsheet - Disable Formula Cached
use \PhpOffice\PhpSpreadsheet\Calculation\Calculation;
Calculation::getInstance($spreadsheet)->disableCalculationCache();
Calculation::getInstance()->setCalculationCacheEnabled(FALSE);