Skip to content

Instantly share code, notes, and snippets.

View briansanchez's full-sized avatar

Brian Sanchez briansanchez

View GitHub Profile
@briansanchez
briansanchez / vue-datatables-example.html
Created July 22, 2020 23:00 — forked from bseib/vue-datatables-example.html
Vue + DataTables + load once
<!DOCTYPE html>
<html>
<head>
<title>Example Vue + DataTables</title>
<!-- I happened to be using the bootstrap styling w/ DataTables. You may not need this. -->
<link rel="stylesheet" href="/path/to/datatables/DataTables-1.10.16/css/dataTables.bootstrap4.min.css">
</head>
<body>
<div id="example-page">
@briansanchez
briansanchez / gist:c073bca39cd51e09b8d239987a971edc
Last active September 26, 2020 20:19
bash script to extract emails from txt files
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
TXT_FILES_DIR=$DIR/txt
#check if directory is not empty
if [ "$(ls -A $TXT_FILES_DIR)" ]; then
#concatenate all text files in 1 log txt file
cat $DIR/txt/*.txt > $DIR/txt_done/log.txt_"$(date +%Y%m%d-%H%M%S)".txt
#extract emails from log.emails txt file
egrep -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" $DIR/txt_done/log.txt_"$(date +%Y%m%d-%H%M%S)".txt > $DIR/txt_done/log.emails.txt_"$(date +%Y%m%d-%H%M%S)".txt;