Skip to content

Instantly share code, notes, and snippets.

View khanhicetea's full-sized avatar
😎
solving human problems

KhanhIceTea khanhicetea

😎
solving human problems
View GitHub Profile
Keybinding Action Tag
Ctrl+X Cut line (empty selection) basic-editing
Ctrl+C Copy line (empty selection) basic-editing
Alt+ ↓ / ↑ Move line down/up basic-editing
Ctrl+Shift+K Delete line basic-editing
Ctrl+Enter Insert line below basic-editing
Ctrl+Shift+Enter Insert line above basic-editing
Ctrl+Shift+\ Jump to matching bracket basic-editing
Home Go to beginning basic-editing
End Go to end of line basic-editing
Calc size of root directories
```bash
du -h . --max-depth=1 | sort -n -r | head -n 10
```
@khanhicetea
khanhicetea / Development.md
Created April 12, 2020 05:12
[Feed] Good Websites
@khanhicetea
khanhicetea / utm_passing.js
Last active November 7, 2019 14:16
Pass UTM query params to all link in web page
(function() {
const params = new URLSearchParams(window.location.search);
const utm_params = [];
params.forEach(function(value, key) {
if (key.startsWith('utm_')) {
utm_params.push(key+'='+value)
}
})
utm_search = utm_params.join('&');
if (!!utm_search) {
@khanhicetea
khanhicetea / onepay.php
Last active November 7, 2019 03:16
OnePay Vietnam PHP SDK
<?php
class OnePayGateway
{
private $options = [
'version' => '2',
'currency' => 'VND',
'merchant' => 'ONEPAY',
'access_code' => 'D67342C2',
'secure_hash' => 'A3EFDFABA8653DF2342E8DAC29B51AF0',
@khanhicetea
khanhicetea / area.php
Last active May 26, 2019 16:10
Danh sách địa phương (tỉnh / tp > quận / huyện > phường / xã)
<?php
// https://github.com/madnh/hanhchinhvn/tree/master/dist
$result = [];
$data = json_decode(file_get_contents('tree.json'), true);
foreach ($data as $a => $province) {
$p = [];
foreach ($province['quan-huyen'] as $b => $district) {
$d = [];
foreach ($district['xa-phuong'] as $c => $ward) {
@khanhicetea
khanhicetea / iframe.html
Last active July 15, 2019 08:18
Test Iframe in webview
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
var setTempCookie = function (name, value) {
var now = new Date(),
@khanhicetea
khanhicetea / install.sh
Last active October 1, 2018 16:31
[Install php in ubuntu via ppa] #php #ubuntu
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.1-bz2 php7.1-cli php7.1-common php7.1-curl php7.1-dev php7.1-fpm php7.1-gd php7.1-imap php7.1-intl php7.1-json php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-opcache php7.1-readline php7.1-soap php7.1-sqlite3 php7.1-xml php7.1-xmlrpc php7.1-xsl php7.1-zip
@khanhicetea
khanhicetea / encoding-video.md
Created June 4, 2018 10:17 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@khanhicetea
khanhicetea / encrypt.md
Last active October 1, 2018 16:32
[Encrypt and Decrypt file using openssl] #encrypt #decrypt

Encrypt

openssl enc -aes-256-cbc -in [input] -out [output]

Decrypt

openssl enc -aes-256-cbc -d -in [input] &gt; [output]