Moved to
View UnionIntersection.ts
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
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never | |
type IntersectionToUnion<I> = (I extends any ? (x: I) => any : never) extends ((x: infer U) => any) ? U : never; |
View ShellBrowse.vbs
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
Option Explicit | |
' Flags for the options parameter | |
Const BIF_returnonlyfsdirs = &H0001 | |
Const BIF_dontgobelowdomain = &H0002 | |
Const BIF_statustext = &H0004 | |
Const BIF_returnfsancestors = &H0008 | |
Const BIF_editbox = &H0010 | |
Const BIF_validate = &H0020 | |
Const BIF_browseforcomputer = &H1000 |
View islanders.ts
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
// Random Integer from m to n excluding e | |
const randInt = (m: number, n: number, e?: number): number => { | |
const result = Math.floor(Math.random() * m) + n; | |
return e == undefined ? result : | |
result == e ? randInt(m, n, e) : | |
result | |
} | |
class Person { constructor(public weight: number) {} } |
View Functional.ts
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
/** Number Expressions */ | |
// data | |
type Exp = | |
{ tag: 'Lit', value: number } | | |
{ tag: 'Add', left: Exp, right: Exp } | |
// operations | |
function evaluate(exp: Exp): number { | |
switch (exp.tag) { |
View downloadImage.vbs
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
Dim document : Set document = WScript.GetObject("http://example.com") | |
While document.readyState <> "complete" : WScript.Sleep 200 : Wend | |
Dim xhr : Set xhr = CreateObject("MSXML2.XMLHTTP.3.0") | |
xhr.open "GET", document.getElementsByTagName("img")(0).src, False | |
xhr.send | |
Dim stream : Set stream = CreateObject("Adodb.Stream") | |
stream.Type = 1 | |
stream.Open | |
stream.Write xhr.responseBody | |
stream.SaveToFile "C:\..\foo.jpg", 2 |
View parameters.vbs
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
Class Person | |
Private m_Age | |
Private m_Name | |
Public Default Function Init(Name, Age) | |
m_Name = Name | |
m_Age = Age | |
Set Init = Me | |
End Function |
View error.txt
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
Context: <https://groups.google.com/a/magnolia-cms.com/g/user-list/c/MRpHYKkOMhA> | |
Type Exception Report | |
Message com.machinezoo.noexception.WrappedException: java.net.ConnectException: Connection refused (Connection refused) | |
Description The server encountered an unexpected condition that prevented it from fulfilling the request. | |
Exception |
View cyclicPerms.js
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
// cyclicPerms(5) | |
// "1,2,3,4,5 | |
// 2,3,4,5,1 | |
// 3,4,5,1,2 | |
// 4,5,1,2,3 | |
// 5,1,2,3,4" | |
const cyclicPerms = (n) => | |
Array.from({length: n},(_,i) => i + 1) | |
.map((_, i, xs) => [...xs, ...xs].slice(i, i+n)) | |
.join('\n') |
View htmlTitleList.vbs
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
'Reference: <http://www.visualbasicscript.com/tm.aspx?high=&m=95638&mpage=1> | |
Option Explicit | |
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") | |
Dim files : Set files = fso.GetFolder("C:\test\").Files | |
Dim file | |
For Each file In files | |
If file.Type = "Firefox Document" Then '<-- update for your system | |
Dim doc : Set doc = CreateObject("htmlfile") | |
doc.write fso.OpenTextFile(file.Path).ReadAll() |
NewerOlder