This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/behitek/text-classification-tutorial/blob/master/text_classification_tutorial.ipynb | |
import os | |
import emoji | |
import urllib | |
import requests | |
import regex as re | |
from io import StringIO | |
from vncorenlp import VnCoreNLP | |
from transformers import pipeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// INSERT HOADON | |
FOR hoadon in [ | |
{MAHD: "HD01", KHACHHANG: "Nguyen Duc Tri", SDT: "0937859594", DIACHI: "Ap 3,Tan Thanh, Thu Thua, Long An", MANV: "NV04"}, | |
{MAHD: "HD02", KHACHHANG: "Nguyen Hoang Nhan", SDT: "028347852", DIACHI: "Tan Mai, Bien Hoa, Dong Nai", MANV: "NV03"}, | |
{MAHD: "HD03", KHACHHANG: "Dang Hoang Quan", SDT: "036845271", DIACHI: "Phuong 15, Tan Binh, TP.HCM", MANV: "NV04"}, | |
{MAHD: "HD04", KHACHHANG: "Nguyen Duc Tri", SDT: "0937859594", DIACHI: "Ap 3,Tan Thanh, Thu Thua, Long An", MANV: "NV03"} | |
] INSERT hoadon INTO HOADON | |
// INSERT NHANVIEN | |
FOR nhanvien IN [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import vobject | |
def vcard_to_csv(vcard_filename, csv_filename): | |
with open(vcard_filename, 'r', encoding='utf-8') as vcard_file: | |
vcards = vobject.readComponents(vcard_file.read()) | |
with open(csv_filename, mode='w', newline='', encoding='utf-8') as csv_file: | |
fieldnames = ['Name', 'Phone(s)', 'Email(s)', 'Address(es)'] | |
writer = csv.DictWriter(csv_file, fieldnames=fieldnames) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
document.querySelector('.MainColumn_column__UEunw').style.width = '100%'; | |
document.querySelector('.ChatPageMain_container__2O2h8').style.maxWidth = '100%'; | |
document.querySelectorAll('.Message_botMessageBubble__aYctV, .Message_humanMessageBubble__DtRxA').forEach(mess => mess.style.maxWidth='100%'); | |
var addCSS = css => document.head.appendChild(document.createElement("style")).innerHTML = css; | |
addCSS('::-webkit-scrollbar { width: unset!important }'); | |
addCSS('::-webkit-scrollbar-thumb { background-color: lightgray }'); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/7992689/how-to-loop-over-files-in-natural-order-in-bash | |
# https://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers | |
readarray -d '' entries < <(printf '%s\0' *.png | sort -zV) | |
num=10846 | |
for entry in "${entries[@]}"; do | |
new=$(printf "%07d.png" "$num") #07 pad to length of 7 | |
mv -i -- "$entry" "$new" | |
echo "${entry} -> ${new}" | |
let num=num+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>Interactive 3D Character with Three.js | Codrops</title> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
<script> | |
document.documentElement.className = 'js'; | |
let supportsCssVars = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ask for administrator privilege | |
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
Start-Process PowerShell -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`""; | |
exit; | |
} | |
# Check if Python exists before installation | |
if(&{python -V} 2>&1 -is [System.Management.Automation.ErrorRecord]) { | |
$TEMP_DIR = [System.IO.Path]::GetTempPath() | |
$PYTHON_VERSION = "3.8.10" # Specify Python version from https://www.python.org/downloads/windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'(VN) Hàm thêm dấu Tiếng Việt & sửa lỗi chính tả cho Excel | |
'(EN) Predict Vietnamese tone & spell checking for Excel | |
#If VBA7 Then 'For 64 Bit Systems | |
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) | |
#Else 'For 32 Bit Systems | |
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) | |
#End If | |
Function FormatResponse(response As Object, sentence As String) As String | |
Dim wordSuggestion As Dictionary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Win32; | |
using System.Diagnostics; | |
using System.IO; | |
namespace ConsoleApp { | |
class Program { | |
static void Main(string[] args) { | |
// https://www.kunal-chowdhury.com/2016/06/how-to-retrieve-office-version.html | |
// Enable for default Office version | |
string regOutlook32Bit = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...document.querySelectorAll('ytd-thumbnail-overlay-time-status-renderer>span')].map(el => { | |
let timeSplit = el.innerText.split(':'); | |
let lastIndex = timeSplit.length - 1; | |
let second = timeSplit[lastIndex] * 1; | |
for (let i = 0; i < lastIndex; i++) | |
second += timeSplit[i] * 60 ** (lastIndex - i); | |
return second; | |
}).reduce((total, second) => total + second); | |
/* |
NewerOlder