Skip to content

Instantly share code, notes, and snippets.

View michaelkeevildown's full-sized avatar

Michael Down michaelkeevildown

View GitHub Profile
@michaelkeevildown
michaelkeevildown / credit-card-regex.md
Last active April 17, 2024 20:36
Credit Card Regex Patterns

Credit Card Regex

  • Amex Card: ^3[47][0-9]{13}$
  • BCGlobal: ^(6541|6556)[0-9]{12}$
  • Carte Blanche Card: ^389[0-9]{11}$
  • Diners Club Card: ^3(?:0[0-5]|[68][0-9])[0-9]{11}$
  • Discover Card: ^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
  • Insta Payment Card: ^63[7-9][0-9]{13}$
  • JCB Card: ^(?:2131|1800|35\d{3})\d{11}$
  • KoreanLocalCard: ^9[0-9]{15}$
@michaelkeevildown
michaelkeevildown / opennlp-trainer.txt
Last active September 15, 2022 23:49
OpenNLP TokenNameFinderTrainer Example
# tested on opennlp 1.5.3
# download here: http://apache.mirror.anlx.net/opennlp/opennlp-1.5.3/apache-opennlp-1.5.3-bin.zip
./bin/opennlp TokenNameFinderTrainer \
-lang en \
-encoding utf-8 \
-iterations 50 \
-type person \
-model names.bin \
-data test-data-names.txt
@michaelkeevildown
michaelkeevildown / ssl-transmission-nginx.conf
Created June 13, 2016 18:05
SSL Transmission Nginx Config
server {
listen 80 default_server;
server_name domain.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 default_server;
server_name domain.com;
@michaelkeevildown
michaelkeevildown / es-reindex-with-script.md
Last active March 12, 2020 21:22
Reindex Elasticsearch Data With Script

How to reindex data and using inline (painless) script

PUT /data/logs/1
{
  "title": "This is a document",
  "one": 1,
  "two": 2
}
@michaelkeevildown
michaelkeevildown / fitz.md
Created January 4, 2019 20:34
Robin Hobb Fitz Books in Order

The Farseer Trilogy:

  1. Assassin's Apprentice
  2. Royal Assassin
  3. Assassin's Quest

Followed by the Liveship Traders Trilogy

  1. Ship of Magic
  2. Mad Ship
  3. Ship of Destiny
@michaelkeevildown
michaelkeevildown / ml-workshop.md
Last active April 15, 2019 14:18
ML Workshop
We couldn’t find that file to show.
@michaelkeevildown
michaelkeevildown / example1.md
Last active January 14, 2019 17:10
XSLT Example

Input XML:

<root>
    <id>trans-123</id>
    <transactions>
        <transaction>
            <sku>123</sku>
            <price currency="GBP">100<price>
        </transaction>
@michaelkeevildown
michaelkeevildown / 1-raw-data.md
Created December 5, 2018 15:32
Kibana Vega - Percentage of X in a whole index

Raw Data

The below can be copied and pasted straight into Kibana Dev Tools:

POST percentage/_doc
{
  "stage": 1
}
@michaelkeevildown
michaelkeevildown / es-sink-flink.java
Created November 27, 2018 11:24
Flink (v1.6) Elasticsearch (v6.x) Sink -- with auth
@michaelkeevildown
michaelkeevildown / ssh-tunnel.md
Last active June 24, 2018 14:05
Plex SSH Tunnel