Skip to content

Instantly share code, notes, and snippets.

View micti's full-sized avatar
🐢

Lê Nhật Anh micti

🐢
  • Da Nang, Vietnam
View GitHub Profile

Create Root Certificate Authority and self-signed certificate for your Home Assistant. Compatible with Chrome browser > version 58, including the macOS Catalina 10.15 / iOS 13 (and above) new requirements.

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@micti
micti / example.markup.html
Created March 29, 2019 06:31
Display name of file for Bulma Input File
<!-- https://bulma.io/documentation/form/file/ -->
<div class="file has-name">
<label class="file-label">
<input class="file-input" type="file" name="resume">
<span class="file-cta">
<span class="file-icon">
<i class="fas fa-upload"></i>
</span>
<span class="file-label">
@micti
micti / form.html
Last active July 26, 2017 07:38
Form
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="../JS/JQuery/jquery-2.1.3.js"></script>
<link href="JS/jquery-ui-1.11.2/jquery-ui.min.css" rel="stylesheet" />
<script src="../JS/jquery-ui-1.11.2/jquery-ui.min.js"></script>
<script src="../JS/bootstrap/js/bootstrap.js"></script>
<link href="JS/bootstrap/css/bootstrap.css" rel="stylesheet" />
<link href="JS/bootstrap-datepicker-master/css/bootstrap-datepicker.css" rel="stylesheet" />
@micti
micti / message.php
Created November 8, 2015 09:15
Iphone One Contact Message Export
<?php
// 3d0d7e5fb2ce288813306e4d4636395e047a3d28 -> sqlite file for messages of iphone backup
// handle_id: contact
$sql = new SQLite3('3d0d7e5fb2ce288813306e4d4636395e047a3d28');
$res = $sql->query('select * from message where handle_id = 290 order by date');
$dat = '';
while ($row = $res->fetchArray(SQLITE3_ASSOC)) {
$dat .= $row['text'] . "\n\n";
@micti
micti / info.md
Last active September 30, 2015 00:48
Ubuntu 15.04 - Info

##Mount VB Shared folder

sudo mount -t vboxsf Share ~/Share

##Something

apt-get install --yes build-essential

##Nodejs

@micti
micti / draw_et_seed.py
Created July 9, 2015 16:53
Elimination Tournament - Seed Order for 1st Round
# Elimination Tournament
# Seed Order for 1st Round
# Examples:
# 1 4 3 2 or 1 8 5 4 3 6 7 2
# total : number of compitetor
def draw_et_seed(total):
round = 1
max = 2
@micti
micti / 69374.phpt
Last active August 29, 2015 14:19
Test script #69374 & #69398
<?php
$millitimestamp = 1428133423941.0; // 14:43:43 April 04 2015
$pattern1 = '\'tháng\' MM, y'; // yMM format for Vietnamese
$pattern2 = 'y년 MMM'; // yMM format for Korean
$date = IntlCalendar::createInstance('Asia/Ho_Chi_Minh');
$date->setTime($millitimestamp);
echo IntlDateFormatter::formatObject($date, $pattern1, 'vi_VN'), "\n";
echo IntlDateFormatter::formatObject ($date, $pattern2, 'ko_KR'), "\n";
?>
tháng 04, 2015
private string ChuyenSo(string number)
{
string[] dv = { "", "mươi", "trăm", "nghìn", "triệu", "tỉ"};
string[] cs = { "không", "một", "hai", "ba", "bốn", "năm", "sáu", "bảy", "tám", "chín" };
string doc;
int i, j, k, n, len, found, ddv, rd;
len = number.Length;
number += "ss";
doc = "";