Skip to content

Instantly share code, notes, and snippets.

View rmckeel's full-sized avatar

Ryan McKeel rmckeel

View GitHub Profile
@rmckeel
rmckeel / tensorflow-qna-example.html
Last active August 30, 2021 23:08
Simple tensorflow.js question & answer search over text
<!DOCTYPE html>
<html lang="en">
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/qna"></script>
<script>
const searchText = 'Afghanistan (/æfˈɡænɪstæn, æfˈɡɑːnɪstɑːn/ (About this soundlisten);[12] Pashto/Dari: افغانستان, Afġānestān [avɣɒnesˈtɒn]) is a landlocked country at the crossroads of Central and South Asia. It is bordered by Pakistan to the east and south, Iran to the west, Turkmenistan and Uzbekistan to the north, and Tajikistan and China to the northeast. Occupying 652,864 square kilometers (252,072 sq mi), the country is predominately mountainous with plains in the north and southwest. It is inhabited by 31.4 million people as of 2020, composed mostly of ethnic Pashtuns, Tajiks, Hazaras, and Uzbeks. Kabul serves as its capital and largest city.\n' +
'\n' +
'Human habitation in Afghanistan dates back to the Middle Paleolithic Era, and the country\'s strategic location along the Silk Road connected it to the c
@rmckeel
rmckeel / gulp-spawn.js
Last active August 9, 2021 23:37
Gulp no-dependency spawn / execute a file with live stdout feedback
const gulp = require( 'gulp' );
const spawn = require( 'child_process' ).spawn;
/**
* This solution to execute and watch a shell function from Gulp is
* adapted from https://stackoverflow.com/a/10232330/3232832
*
* e.g. callSpawn( 'ping', [ '-c 5', 'google.com' ], cb );
*/
function callSpawn( command, arguments, cb ) {
@rmckeel
rmckeel / colors.scss
Last active April 13, 2018 15:39
SCSS and LESS color variables for data visualization and web applications (Google Material Design)
/**
* Compilation of colors for data visualization and web application purposes.
* Compiled by Ryan McKeel.
*
* Can be easily converted to LESS by changing `$` character to `@`
*/
// similar to HighCharts colors (with tiny modifications to avoid exact colors), retrieved from http://www.highcharts.com/demo/area-basic/grid
$rmChartBlue: #058dc8;
$rmChartGreen: #51b433;
@rmckeel
rmckeel / Configure Exim on cPanel to use Mailgun SMTP
Last active June 14, 2021 08:46 — forked from andcam/Configure Exim on cPanel to use Mailgun SMTP
Method for redirecting all email on a Linux WHM server for one domain to Mailgun for reliable delivery
# This allows you to route all email from a Linux WHM server using exim through the Mailgun service
# or other email service. This is very powerful because email from a server is typically untrusted
# and hard to get good email delivery.
# This is not tested on servers that host multiple domains, because Mailgun's service is specific
# to one domain. If you figure out multiple domains with Mailgun, write it in the comments or fork this!
# Log in to WHM, go to Exim Configuration Manager -> Advanced Editor tab then edit the following.
### NOTE!
# If setting hosts_require_auth and hosts_require_tls = smtp.mailgun.org,