Skip to content

Instantly share code, notes, and snippets.

View tranquangchau's full-sized avatar

Trần Quang Châu tranquangchau

View GitHub Profile
@tranquangchau
tranquangchau / main.dart
Created April 10, 2022 17:04
list view have image, can drap if in mobile
///https://docs.flutter.dev/cookbook/effects/drag-a-widget
import 'package:flutter/material.dart';
void main() {
runApp(
const MaterialApp(
home: ExampleDragAndDrop(),
debugShowCheckedModeBanner: false,
),
///https://dartpad.dev/?id=c5cd30bc8f043796078ce0da5d0263f9
///https://github.com/vicradon/shopping-cart-app
import 'package:flutter/material.dart';
import 'dart:async';
class CartItemsBloc {
/// The [cartStreamController] is an object of the StreamController class
/// .broadcast enables the stream to be read in multiple screens of our app
final cartStreamController = StreamController.broadcast();
@tranquangchau
tranquangchau / php editor online.php
Created March 21, 2022 10:44
run script with editor
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="en" />
<meta http-equiv="content-script-type" content="text/javascript" />
<meta http-equiv="imagetoolbar" content="no"/>
@tranquangchau
tranquangchau / symfony5-create-bundle.sh
Created February 14, 2020 04:05 — forked from sourcerebels/symfony2-create-bundle.sh
PHP > Symfony5 > Clear routes and twig templates cache
# Execute this from your Symfony2 path
php bin/console cache:clear --env=prod --no-debug
@tranquangchau
tranquangchau / read_csv.php
Created January 17, 2020 06:53 — forked from selwynpolit/read_csv.php
Php code to read a csv file of any size without exhausting memory and let you process it in chunks
/*
Reads a CSV file in chunks of 10 lines at a time
and returns them in an array of objects for processing.
Assumes the first line of the CSV file has headings
that will be used as the object name for the item you are
processing. i.e. the heading is CurrentURL then refer to
$item->CurrentURL
@tranquangchau
tranquangchau / wordpress wp_postmeta export mysql sql.php
Last active December 28, 2019 04:45
wordpress wp, export datbase post wp_postmeta
<?php
$servername = "localhost";
$username = "site_wp_bk_1812";
$password = "";
$dbname = "site_wp_bk_1812";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
#1 day Friday, December 20, 2019 12:00 PM
#trigger:
#- master
name: "Name run run 24h at 00AM"
@tranquangchau
tranquangchau / check_pass_first.php
Created December 17, 2019 08:16
script php basic check password first before run everything
<?php
session_start();
$errorMsg = "";
$validUser = false;
if(isset($_SESSION['firstlogin'])) {
$validUser = $_SESSION["firstlogin"] === true;
}
//$pass_has = password_hash("123456", PASSWORD_DEFAULT);
//echo $pass_has; //get password first
<?php
if(isset($_POST["sub"])) {
$pass_has = password_hash($_POST['firstpassword'], PASSWORD_DEFAULT);
echo $pass_has; //get password first
// die;
}
?>
@tranquangchau
tranquangchau / adminer_pass.php
Created December 17, 2019 08:03
adminer have password fist before use
<?php
session_start();
$errorMsg = "";
$validUser = false;
if(isset($_SESSION['firstlogin'])) {
$validUser = $_SESSION["firstlogin"] === true;
}
//$pass_has = password_hash("123456", PASSWORD_DEFAULT);
//echo $pass_has; //get password first