Skip to content

Instantly share code, notes, and snippets.

c7x43t

Block or report user

Report or block c7x43t

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Building with Visual Studio 2019.md

cmake -G "Visual Studio 16 2019" -A x64

intel compiler names: icc/icpc/ifort C/C++/Fortran

cmake -G "Your Generator" -D CMAKE_C_COMPILER=gcc-4.2 -D CMAKE_CXX_COMPILER=g++-4.2 path/to/your/source

CC=gcc-4.2 CXX=/usr/bin/g++-4.2 cmake -G "Your Generator" path/to/your/source

C:\Users\c7x43t\Documents\rust\symspell\hyperscan

@c7x43t
c7x43t / README.md
Created Jun 6, 2019 — forked from lovasoa/README.md
Compute the intersection of large arrays in javascript
View README.md

Array intersect

Fastest function to intersect a large number of big arrays in javascript, without dependencies

  • The compressed version is only 345 caracters long.
  • Faster than common libraries, even a large number of arrays, or on very big arrays. (See benchmarks)

Usage

View router.js
// unfinieshed
function matchAll(regEx,str,group=0){
regEx.lastIntex=0;
var match;
var results=[];
while((match=regEx.exec(str))!==null){
results.push(match[group]);
}
return results;
}
View Symspell.js
// index size: ~ 146kB / distance / 1000 words
// https://www.kaggle.com/yk1598/symspell-spell-corrector
// https://github.com/wolfgarbe/SymSpell
function calculateWordDistance1Deletes(word){
var deletes={};
var fragment;
for(var j=0;j<word.length;j++){
fragment=wordCut(word,j);
deletes[fragment]!==undefined?deletes[fragment]++:(deletes[fragment]=1);
}
@c7x43t
c7x43t / tls.conf
Last active Dec 10, 2018 — forked from pascalandy/tls.conf
My Ghost blog, NGiNX TLS configuration | X25519 & secp384r1 | RSA & ECDSA
View tls.conf
# RSA
ssl_certificate /path/fullchain.pem;
ssl_certificate_key /path/privkey.pem;
# ECDSA
ssl_certificate /path/0001_chain.pem;
ssl_certificate_key /path/itchy.nl.ec.key;
ssl_dhparam /path/dhparam4096.pem;
View DOMParser minimal example.js
var html = '<div id="test_div"><ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul></div>';
var parser = new DOMParser();
var wrapper = parser.parseFromString(html, "text/html"); // this is a DocumentFragment
// Polyfill for DOMParser.parseFromString to support html: https://developer.mozilla.org/de/docs/Web/API/DOMParser
View Mutation Observer minimal example.js
function handler(mutations) {}
var observer = new MutationObserver(handler);
var options = {attributes: true}
observer.observe(element, options);
View gist:935a7cbd457a16936001105cb57b5eb4
// Source: http://code.google.com/p/gflot/source/browse/trunk/flot/base64.js?r=153
/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
* Version: 1.0
* LastModified: Dec 25 1999
* This library is free. You can redistribute it and/or modify it.
*/
/*
* Interfaces:
View turbo-http chunked performance profile.txt
Statistical profiling result from isolate-0x55f6bb94e1f0-v8.log, (7139 ticks, 137 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
318 4.5% /usr/bin/node
194 2.7% /lib/x86_64-linux-gnu/libc-2.27.so
18 0.3% /usr/lib/x86_64-linux-gnu/libuv.so.1.0.0
2 0.0% [vdso]
1 0.0% /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
View IterableObjects.js
Object.prototype[Symbol.iterator]=function* objectIterator(){
const keys=Object.keys(this);
for(var i=0;i<keys.length;i++) yield keys[i];
}
You can’t perform that action at this time.