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 / main.js
Created February 13, 2018 17:48
Console.table Testing
var people = [{name: "BOB", id: 340303, report: true, options: {admin: false} }, {name: "JOHN", id: 340304, report: false, options: {admin: true} }];
console.table(people);
@nhalstead
nhalstead / index.html
Last active February 22, 2018 04:12
Message Post
<html>
<head><style>* { font-family:Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; }</style></head>
<body>
<table cellpadding="0" cellspacing="0" style="padding-top:32px;background-color:#ffffff;">
<tbody>
<tr>
<td style="max-width:560px;padding:24px 24px 32px;background-color:#fafafa;border:1px solid #e0e0e0;border-radius:2px">
<img style="padding:0 24px 16px 0;float:left" width=72 height=72 alt="Error Icon" src="https://png.icons8.com/color/80/000000/chat.png">
<table style="min-width:272px;padding-top:8px">
<tbody>
@nhalstead
nhalstead / config.php
Last active February 26, 2018 01:38
DB String Config
<?php
/**
* DB String Processing
* Provide something like `mysql://admin:[email protected]:4844/mydbselection`
* and get back an array of the data, sorted to the proper data.
*
* @link https://regex101.com/r/e8gkkx/2/
* @param String Database URL Config Processing
* @return Array Reutnrs and Array with Type, Username, Password, Host, Port, HostPort, DB
@nhalstead
nhalstead / arrayMap.php
Last active March 7, 2018 19:53
Array Map
<?php
/**
* Check the Array Map against the Input Array.
*
* @author Noah Halstead <[email protected]>
* @link https://gist.github.com/nhalstead/36b3ed131d3ae7c48d72fc4abcb98adf
* @param Array The Map of what the Input should look like.
* @param Array The Input Array.
* @return Array the Steps of the Detection Process.
*/
<?php
/**
* Fill the Gaps, Fit Text to a Length.
*
* @param Int Input of the Target Length
* @param String The Text to Extend with $char
* @param String The Char to use to fill the blanks.
*/
function fitText($textLength, $text, $char = " "){
$t = strlen($text);
@nhalstead
nhalstead / encryption.php
Last active March 15, 2018 16:23
PHP_MCRYPT_CBC_256
<?php
/**
* Used to encrypt data for Web Transport.
*
* Code from the link attached and modified to be better.
* @link http://truelogic.org/wordpress/2012/09/14/url-masking-by-encrypting-query-string/
* @param Array Data to Encrypt and Return
* @param String Encryption Key used to make the Output
*/
@nhalstead
nhalstead / class.user.php
Last active April 14, 2018 18:51
Update Deniz
<?php
require_once("db_config.php");
class User {
protected $db;
public $id = null;
private static $instance = null;
/**
* Create an Instace of the User Class and Return it.
* @return User
@nhalstead
nhalstead / array-to-texttable.php
Last active April 16, 2018 02:50 — forked from tony-landis/array-to-texttable.php
PHP: Array to Text Table Generation Class
<?php
/**
* Array to Text Table Generation Class
*
* @author Tony Landis <[email protected]>
* @link http://www.tonylandis.com/
* @copyright Copyright (C) 2006-2009 Tony Landis
* @license http://www.opensource.org/licenses/bsd-license.php
*/
@nhalstead
nhalstead / LICENSE.txt
Created April 23, 2018 16:17
Simple Queue Processor in PHP
MIT License
Copyright (c) 2018 Noah Halstead
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@nhalstead
nhalstead / handle.js
Last active January 16, 2019 15:42
Handle Controller
/**
* You can use this to create callbacks by event names
* Use .on events to listen for the selected event
* Use .handle followed by the triggering event to execute
* all of the matching events
*
* @author Noah Halstead <[email protected]>
*/
function EventSpooler(){
this.Events = {};