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/34882591/upgrading-iis-classic-asp-javascript-jscript-scripting-engines-to-chakra | |
var _htmlfile = WScript.CreateObject('htmlfile'); | |
_htmlfile.write('<meta http-equiv="x-ua-compatible" content="IE=11" />'); | |
// expose more modern methods from htmlfile | |
var JSON = _htmlfile.parentWindow.JSON; | |
String.prototype.trim = _htmlfile.parentWindow.String.prototype.trim; | |
String.prototype.padStart = _htmlfile.parentWindow.String.prototype.padStart; | |
Array.prototype.indexOf = _htmlfile.parentWindow.Array.prototype.indexOf; | |
Array.prototype.forEach = _htmlfile.parentWindow.Array.prototype.forEach; | |
Array.prototype.map = _htmlfile.parentWindow.Array.prototype.map; |
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
@ECHO OFF | |
setlocal enableextensions | |
::--------------------------------------------------------------- | |
:: DEFINE SETTING | |
::--------------------------------------------------------------- | |
SET ext=*.MOV *.MTS *.AVI *.MP4 *.MPG *.M4V | |
SET vlc_path=C:\Program Files\VideoLAN\VLC\vlc.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
//https://pablotron.org/2022/03/09/fastest-js-html-escape/ | |
const _esc = (v) => v | |
.replaceAll('&', '&') | |
.replaceAll('<', '<') | |
.replaceAll('>', '>') | |
.replaceAll("'", ''') | |
.replaceAll('"', '"'); | |
var a = {a:'vispa',b:'teresa', list:[{v:'1',t:'uno'},{v:'2',t:'due'},{v:'3',t:'t<r>e'}]} | |
const fn = (j) => ` |
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
for (var i = 1; i < 5; i++){ | |
setTimeout(() => { console.log(i); }, 1000); | |
} | |
// 5 5 5 5 | |
for (let i = 1; i < 5; i++){ | |
setTimeout(() => { console.log(i); }, 1000); | |
} | |
// 1 2 3 4 |
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
-- wont my sscc from sequence | |
-- prefix(8) + year(2) + serial(7) + check digit(1) | |
-- 08008443 21 0001234 D | |
USE [intranet] | |
GO | |
-- create sscc with part serial restart by year | |
drop sequence if exists s_sscc | |
go | |
CREATE SEQUENCE [dbo].[s_sscc] |
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
var l,m,i,d; | |
for(m=(new Date).valueOf(),i=0;i<1000;i++) d=luxon.DateTime.local().plus({days:i}).toFormat('ddcccccMM'); | |
m = (new Date).valueOf()-m; | |
for(l=(new Date).valueOf(),i=0;i<1000;i++) d=luxon.DateTime.local().plus({days:i}).setLocale('it').toFormat('ddcccccMM'); | |
l = (new Date).valueOf()-l; | |
console.log(m,l,'-->',Math.round(1000*(l-m)/m)/10,'%++'); | |
// expect time like: | |
// no setLocale: 10 | |
// setLocale('it'):246 |
NewerOlder