Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
@nhalstead
nhalstead / parent_child.js
Created March 20, 2020 15:17
Parent Child Relation
// Link to the Child via a Child List (Parent Has the Children) aka Looking Down
parentChildData={(currentRow, allRows) => allRows.find(entry => _.find(entry.childQuestions, childEntry => childEntry.childQuestion.childQuestionId === currentRow.id))}
// Link to the Child via a Parant List (Child Has the Parents) aka Looking Up
parentChildData={(currentRow, allRows) => currentRow.parentQuestions[0] !== undefined && _.find(allRows, rowEntry => rowEntry.id === currentRow.parentQuestions[0].childQuestion.parentQuestionId)}
@nhalstead
nhalstead / body_message.html
Created March 19, 2020 19:32
Simple Display of an Image on the Body with a message.
<html>
<head>
<style>
figure {
width: -webkit-min-content;
width: -moz-min-content;
min-width: min-content;
max-width: 30vw;
width: auto;
margin: 1em auto;
@nhalstead
nhalstead / keylist.js
Last active March 2, 2020 21:33
Convert Object to an Key Value List and vice versa
/**
* Convert a Key Value List to a Key Value Pair
*
* Input:
* [{key: "enabled", value: true}]
* Output:
* {enabled: true}
*
* @param {object} list
* @return {object}
@nhalstead
nhalstead / xTeVe.md
Last active February 24, 2020 22:01
Service for CentOS to run the xTeVe project. https://github.com/xteve-project/xTeVe

Download xTeVe for CentOS and extract it.

yum install unzip
wget https://xteve.de/download/xteve_2_linux_amd64.zip
unzip xteve_2_linux_amd64.zip

Create a new service file.

vi /etc/systemd/system/xteve.service
@nhalstead
nhalstead / stringHelper.php
Last active June 25, 2020 18:27
String Helpers to insert text inline with simple and easy methods.
<?php
/**
* Helper Function to insert text after a set string is found.
* Insert Text from the head of the string After the Needle
*
* @param string $haystack
* @param string $needle
* @param string $insertText
@nhalstead
nhalstead / memory.php
Last active February 2, 2020 18:17
Get PHP Memory Usage (of the current request).
<?php
echo round(memory_get_usage() / 1024 / 1024, 2) . ' MB';
?>
@nhalstead
nhalstead / loading.html
Created January 22, 2020 04:12
Loading HTMLBody
<!DOCTYPE html><html> <head> <titleLoading.../title><style>body{background-color: #121212;color: #FFFFFF}.loading:after{content: ".";animation: dots 1s steps(5, end) infinite;}@keyframes dots{0%, 20%{color: rgba(0, 0, 0, 0); text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);}40%{color: #FFFFFF; text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0);}60%{text-shadow: 0.25em 0 0 white, 0.5em 0 0 rgba(0, 0, 0, 0);}80%, 100%{text-shadow: 0.25em 0 0 white, 0.5em 0 0 white;}}</style> </head> <body> <div style="padding: 75px 50px 125px;"> <p style="text-align: center;"> <br/> <span style="font-family: tahoma; font-size: 32px;" class="loading">Loading</span> </p></div></body></html>
@nhalstead
nhalstead / LockColumns.php
Created January 21, 2020 04:52 — forked from nullthoughts/LockColumns.php
Lock columns/attributes from updates in Laravel
<?php
namespace App\Traits;
trait LockColumns
{
/**
* Cast locked_columns as a JSON column
*
* @return void
<!DOCTYPE html>
<html>
<head>
<title>Servers Down</title>
<link href="https://fonts.googleapis.com/css?family=Inconsolata|Roboto:400,700" rel="stylesheet">
<style>
body {
font-family: 'Roboto';
background-color: #051411;
text-align: center;
@nhalstead
nhalstead / status_page.html
Last active June 21, 2019 05:45 — forked from eeejay/hosting_good.html
Simple Status Page that has auto Reload and fully controlled by a Meta Tag.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Server Status Page</title>
<meta property="status" content='{"api":"//example.com/server_status.php?format=json","interval":60,"expand":true,"servers":[{"id":12,"short":"Strawberry","online":true,"error":true,"hostname":"nhalstead.me","statusPageLink":false,"serialNumber":"0000","location":{"building":"X","rack":13,"unit":40}}]}'>
<style>
a:hover, a:focus, a:active {
text-decoration: none;
color: inherit;