Skip to content

Instantly share code, notes, and snippets.

View AlexMelw's full-sized avatar

Alex AlexMelw

View GitHub Profile
public static class DocumentLanguageValidator
{
// Language validation regexes
private static readonly string[] RestrictedLanguagePatterns = new string[]
{
// Arabic (Includes Persian and Urdu)
@"[\u0600-\u06FF\u0750-\u077F]", // Arabic Script and Supplement
// Chinese (Unified Han Characters)
@"[\u4E00-\u9FFF]", // Mandarin and Cantonese
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
//taken from http://stackoverflow.com/questions/9521921/why-does-console-log-apply-throw-an-illegal-invocation-error
var module = {
exports: {}
}
function logr() {
var i = -1,
l = arguments.length,
args = [],
@AlexMelw
AlexMelw / notes.md
Last active November 30, 2020 07:57
@AlexMelw
AlexMelw / notes.md
Last active November 16, 2020 09:00
@AlexMelw
AlexMelw / notes.md
Last active November 16, 2020 08:22

JS libraries worth looking at

Mobile touch swiper

A lightweight JavaScript library for creating particles