Skip to content

Instantly share code, notes, and snippets.

View TinhAmLich.bas
Attribute VB_Name = "LunarSolar"
Option Explicit
Const PI As Double = 3.14159265358979 ' Atn(1) * 4
' Compute the (integral) Julian day number of day dd/mm/yyyy, i.e., the number
' of days between 1/1/4713 BC (Julian calendar) and dd/mm/yyyy.
' Formula from
Function jdFromDate(ByVal dd As Long, ByVal mm As Long, ByVal yy As Long) As Long
View docso.js
// code by: Thanh ND
// Copy as you wish. No attribution required.
var mangso = ['không', 'một', 'hai', 'ba', 'bốn', 'năm', 'sáu', 'bảy', 'tám', 'chín'];
function dochangchuc(so, daydu) {
var chuoi = "";
chuc = Math.floor(so / 10);
donvi = so % 10;
if (chuc > 1) {
chuoi = " " + mangso[chuc] + " mươi";
View listview_extended.bas
Option Explicit
Private Sub TextBox1_Change()
Dim rng As Range
Dim q As String
q = LCase(TextBox1.Text)
Dim c As Long
Set rng = Range("rngDaten")
Dim strToSearch As String, i As Long
Dim lRow As Long, lCol As Long
With Me.ListView1
View ComponentsScreen.js
import { StyleSheet, Button } from 'react-native';
import React, { Component } from 'react';
import { Platform, View, Text } from 'react-native';
import { BleManager } from 'react-native-ble-plx';
export default class ComponentsScreen extends Component {
constructor() {
this.manager = new BleManager();
View GAS01.js
function myFunction() {
var x = 'Hello'; // Kiểu string
var z = 23; // Kiểu số, kiểu Number
var y = true; // Kiểu boolean
var array = ['Hello', 'World', 23, 4, false];
array[0] // 'Hello'
var obj = { 'firstName': 'Thanh', 'lastName': 'Nguyen' }
View string_similarity.bas
'Implements functions to rate how similar two strings are on
'a scale of 0.0 (completely dissimilar) to 1.0 (exactly similar)
'Author: Bob Chatham, bob.chatham at
Public Function strSimLookup(str1 As Variant, rRng As Range, Optional returnType) As Variant
'Return either the best match or the index of the best match
'depending on returnTYype parameter) between str1 and strings in rRng)
' returnType = 0 or omitted: returns the best matching string
' returnType = 1 : returns the index of the best matching string
View example-for-editor.html
<p>Đây là một đoạn văn bình thường dành cho việc dẫn dắt</p>
<pre>Đây là một đoạn văn bình thường dành cho việc dẫn dắt</pre>
<pre style="background: rgb(0, 31, 63); color: white;"><p>=SUM(A1:A10)</p></pre>
<pre style="background: rgb(40, 41, 35); color: rgb(103, 216, 239);"><p><strong style="color: rgb(103, 216, 239);">=SUM(A1:A10)</strong></p></pre>
View heo-addin-manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
View test_xlsx_base64.txt
View insertSheets.js
$("#file").change(() => tryCatch(insertSheets));
async function insertSheets() {
const myFile = <HTMLInputElement>document.getElementById("file");
const reader = new FileReader();
reader.onload = (event) => { => {
// strip off the metadata before the base64-encoded string
const startIndex = (<string>(<FileReader>"base64,");
You can’t perform that action at this time.