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
Nguồn: https://www.informatik.uni-leipzig.de/~duc/amlich/LunarSolar.bas
' 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 http://www.tondering.dk/claus/calendar.html
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() {
super()
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)
'Source: http://www.catalysoft.com/articles/StrikeAMatch.html
'Author: Bob Chatham, bob.chatham at gmail.com
'9/12/2010
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>
<blockquote>=SUM(A1:A10)</blockquote>
<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"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
xsi:type="TaskPaneApp">
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
View test_xlsx_base64.txt
UEsDBBQABgAIAAAAIQA/qpqYigEAAPgFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACslMtuwjAQRfeV+g+Rt1Vi6KKqKgKLPpYtUukHmHhCosQPeYbX39dxAKEqJSDYxErsuedmxjOjyUbV0QoclkanbJgMWAQ6M7LUi5T9zD7iZxYhCS1FbTSkbAvIJuP7u9FsawEjH60xZQWRfeEcswKUwMRY0H4nN04J8q9uwa3IKrEA/jgYPPHMaAJNMTUabDx6g1wsa4reN/5z68RBjSx6bQ82rJQJa+syE+Sd8pWWfyjxjpD4yHAGi9Lig7fBeCeh2fkfsIv7
View insertSheets.js
$("#file").change(() => tryCatch(insertSheets));
async function insertSheets() {
const myFile = <HTMLInputElement>document.getElementById("file");
const reader = new FileReader();
reader.onload = (event) => {
Excel.run((context) => {
// strip off the metadata before the base64-encoded string
const startIndex = (<string>(<FileReader>event.target).result).indexOf("base64,");
You can’t perform that action at this time.