Skip to content

Instantly share code, notes, and snippets.

View a3r0id's full-sized avatar
🎯
Focusing

Chad Groom a3r0id

🎯
Focusing
  • ALERTWest, Inc.
  • Chico, California
  • 00:40 (UTC -07:00)
  • X @a3r0id
View GitHub Profile
@a3r0id
a3r0id / ToolTip.js
Last active September 10, 2023 21:41
/*
Author:
github.com/a3r0id
Description:
Basic tooltip class
*/
export class ToolTip{
// ## Synopsis ##
// > triggerSelector: the selector of the element that will trigger the tooltip
@a3r0id
a3r0id / headlines.json
Last active December 24, 2021 07:46
JSON file of aggregated top news headlines that is consistently updated (programatically) every 20 minutes.
This file has been truncated, but you can view the full file.
{
"timestamp": "2021-12-24 07:46:42",
"interval_time_seconds": 1200,
"major_headlines": [
{
"dataNode": 0,
"hash": "4969165cae975e5ecbaad6db5a6266e40d027f64",
"text": "Scott Peterson gets life in prison without the possibility of parole at resentencing hearing for the murders of his wife and unborn child\n",
"link": "https://cnn.it/3IxDVTN",
"pubDate": "2021-12-08 19:24:18",
@kfriend
kfriend / respond_and_process.php
Created March 11, 2016 01:35
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();
@neu5ron
neu5ron / valid_domain_name_regex
Last active July 2, 2023 10:40
Valid domain name regex including internationalized domain name
domain_regex = r'(([\da-zA-Z])([_\w-]{,62})\.){,127}(([\da-zA-Z])[_\w-]{,61})?([\da-zA-Z]\.((xn\-\-[a-zA-Z\d]+)|([a-zA-Z\d]{2,})))'
#Python
domain_regex = '{0}$'.format(domain_regex)
valid_domain_name_regex = re.compile(domain_regex, re.IGNORECASE)
self.domain_name = self.domain_name.lower().strip().encode('ascii')
if re.match(valid_domain_name_regex, self.domain_name ):
return True
else:
return False