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 | |
:: Required version of tree-sitter-cli (TODO: update manually as needed) | |
set "treesitter=0.15.14" | |
::======================================= | |
:: Constants |
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
Phone numbers: | |
https://gist.github.com/wizard04wsu/11458504 | |
Email validation (complex): | |
^((?:[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+(?:\.[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+)*)|(?:"(?:(?:(?:(?:[\t ]*\r?\n)?[\t ]+)?(?:[!#$%&'()*+,\-./0-9:;<=>?@A-Z[\]^_`a-z{|}~]|\\[\t !-~])+)+(?:(?:[\t ]*\r?\n)?[\t ]+)?|(?:(?:[\t ]*\r?\n)?[\t ]+))"))@(\d+(?:\.\d+){3}|\[(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){5}:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|\d+(?:\.\d+){3})|(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)\]|(?:[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)(?:\.[0-9A-Za-z](?:[0-9A-Za-z-]{0,61}[0-9A-Za-z])?)*)$ | |
Email validation (simpler): | |
^((?:[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+(?:\.[!#$%&'*+\-/0-9=?A-Z^_`a-z{|}~]+)*)|(?:"(?:[!#$%&'()*+,\-./0-9:;<=>?@A-Z[\]^_`a-z{|}~\t ]|\\[\t !-~])+"))@([A-Za-z-][0-9A-Za-z-]*(?:\.[A-Za-z-][0-9A-Za-z-]*)*|\d+(?:\.\d+){3}|\[[0-9A-Fa-f:.]+\])$ | |
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
function bind(targetFunction, thisArg){ | |
"use strict"; | |
var boundArgs = Array.prototype.slice.call(arguments, 2); | |
try{ | |
return Function.prototype.bind.apply(targetFunction, [thisArg].concat(boundArgs)); | |
}catch(e){ | |
function boundFunction(){ | |
return targetFunction.apply(thisArg, boundArgs.concat(arguments)); | |
} | |
boundFunction.toString = function toString(){ return targetFunction.toString(); }; |
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
function createExcelDownloadLink(xml, filename){ | |
var a = document.createElement('a'); | |
a.href = 'data:application/vnd.ms-excel, '+encodeURIComponent(xml); | |
a.download = filename; | |
return a; | |
} | |
//note: this doesn't work with complicated tables (e.g., merged cells) | |
function tableToExcel(tableElem, title, sheetname){ | |
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
'Be aware that `Range.Copy` and `Range.PasteSpecial` use the clipboard. | |
'copy everything (values, formats, comments, et al.) | |
Private Sub CopyPasteAll(fromRange As Range, toRange As Range) | |
fromRange.Copy toRange | |
End Sub | |
'copy values only (without using the clipboard) |
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
'requires reference to Microsoft VBScript Regular Expressions 5.5 | |
Sub stripHTML() | |
Dim cell As Object | |
For Each cell In Selection | |
If Not (IsEmpty(cell) Or IsNumeric(cell) Or cell.HasFormula) Then | |
On Error Resume Next | |
cell.Value = doStripHTML(cell.Formula) |
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
Sub ToLowerCase() | |
Dim cell As Object | |
For Each cell In Selection | |
cell.Value = LCase(cell.Value) | |
Next | |
End Sub |
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
'requires reference to Microsoft Office 14.0 Object Library | |
'prompts the user for a folder | |
'see http://www.vbaexpress.com/kb/getarticle.php?kb_id=896 | |
Private Function GetFolderName(Optional OpenAt As String) As String | |
With Application.FileDialog(msoFileDialogFolderPicker) | |
.InitialFileName = OpenAt | |
.Show | |
If .SelectedItems.Count = 0 Then Exit Function | |
GetFolderName = .SelectedItems(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"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS to obfuscate text</title> | |
<style> |
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"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Generate Link</title> | |
<style type="text/css" media="all"> |
NewerOlder