Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
{
"type": "Topology",
"bbox": [
102.14208323300005,
6.953306039000038,
116.94732130899999,
23.393902135000033
],
"objects": {
"vn_iso_province": {
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/*
How to swap tokens
1. Alice has 100 tokens from AliceCoin, which is a ERC20 token.
@tolawho
tolawho / extend-rest-api.php
Created October 19, 2020 16:34 — forked from mklasen/extend-rest-api.php
Update Custom Post Type Meta Fields with the WordPress REST API
<?php
register_meta('post', 'custom-field', [
'object_subtype' => 'custom-post-type',
'show_in_rest' => true
]);
void POST_LINE_Message_To_Server(string message)
{
char message_data[], result[];
string RequestMethod = "POST";
string headers = "Content-Type: application/x-www-form-urlencoded" + "\r\n";
headers += "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "\r\n";
int timeout = 10000;
string result_headers = NULL;
string message_text = "message=";
message_text += message;
@tolawho
tolawho / php_cs
Created April 26, 2020 15:17
laravel coding standard (vscode junstyle.php-cs-fixer)
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@tolawho
tolawho / webpack.mix.js
Created April 1, 2020 17:41 — forked from epixian/webpack.mix.js
Laravel Mix / Tailwind UI / PurgeCSS configuration
const mix = require('laravel-mix');
require('laravel-mix-tailwind');
require('laravel-mix-purgecss');
/* Moment.js bloat */
const webpack = require('webpack');
mix.webpackConfig({
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
]
@tolawho
tolawho / docker.md
Created March 8, 2020 03:58 — forked from f3l1x/aliases
Docker - installation, tips, commands, aliases

Docker

Shortcuts

$ curl -fsSL https://raw.github.com/tcnksm/docker-alias/master/zshrc >> ~/.bashrc && source ~/.bashrc
# ------------------------------------
<?php
$ten = 10;
$max = 15;
$current = 0;
$step = 0;
for ($i = 1; $i <= $max; $i++) {
$b = $c = $i;
$d = $current * 10;
$count1 = $count2 = 0;
@tolawho
tolawho / cake.php
Last active November 29, 2018 18:44
<?php
$status = '';
/**
* 1. Đoạn này sai cơ bản, check isset cho filter nhưng lại lấy giá trị cbb,
* nếu có filter mà ko có cbb là có lỗi(có thể viết nhầm cbb thành 1 tên khác). 2 điểm về chỗ đúng rồi
* 2. Chưa filter giá trị $status để chống sql injection: ví dụ dùng addslash để khử dấu ' trong cbb, hoặc quy định biến là kiểu số, ...
*
@tolawho
tolawho / .bashrc
Created September 17, 2018 11:07 — forked from wzup/.bashrc
alias for Git Bash on Windows
# create a file C:\Users\[user]\.bashrc
# add this content
# add your onw aliases or changes these ones as you like
# to make a dot (.bashrs) file in windows, create a file ".bashrs." (without extention) and save. windows will save it as ".bashrc"
alias ls='ls -alh'
alias cdnginx='cd /c/nginx && ls'
alias cdmcga='cd /c/Users/[user]/sbox/node/mcga && ls'
alias cdfood9='cd /c/Users/[user]/sbox/node/food9 && ls'
alias cdmysql='cd /c/nginx/mysql/bin && ls'