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 / api-shorte.php
Last active June 10, 2017 01:27 — forked from dchomicz/api-test.php
Shorte.st Sample API File. Works with V1 of their API
<?php
if(!isset($authKey)) { $authKey = "YOUR KEY HERE"; }
if(!isset($longURL)) { $longURL = "http://join-shortest.com/ref/46cc802beb?user-type=new"; }
$storeShortLink = "linkout";
DEFINE("apiBaseAddress", "https://api.shorte.st/v1/data/url");
function formatURLPostData($url){ return "urlToShorten=".$url; }
function http_exist($url) {
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { return "https://" . $url; }
else { return $url; }

Keybase proof

I hereby claim:

  • I am nhalstead on github.
  • I am nhalstead (https://keybase.io/nhalstead) on keybase.
  • I have a public key ASC4EOcVczfFT369kUqNixC9wA4XYOzgE_uK8k5mM4yDTAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am nhalstead on github.
  • I am nhalstead (https://keybase.io/nhalstead) on keybase.
  • I have a public key ASC4EOcVczfFT369kUqNixC9wA4XYOzgE_uK8k5mM4yDTAo

To claim this, I am signing this object:

@nhalstead
nhalstead / main.cpp
Created August 10, 2017 22:41 — forked from roger-/main.cpp
Part of RTSP server
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** main.cpp
**
** V4L2 RTSP streamer
**
** H264 capture using middleware_video
@nhalstead
nhalstead / url_parse.php
Last active March 1, 2018 22:12
Phrasing URLs in php. From String to Array. From Array to String.
<?php
/**
* @link https://gist.github.com/nhalstead/c3422e9f1fd213d381a12ad6e4664bf3
*/
/**
* Process URL
* @param String URL Input
* @return Array The URL data that is Given.
*/
@nhalstead
nhalstead / proxy.php
Last active January 30, 2018 16:42 — forked from iovar/proxy.php
Simple PHP Proxy Script
<?php
/**
* Warning! Read and use at your own risk!
*
* This tiny proxy script is completely transparent and it passes
* all requests and headers without any checking of any kind.
* The same happens with JSON data. They are simply forwarded.
*
* This is just an easy and convenient solution for the AJAX
* cross-domain request issue, during development.
<?php
$allowed = array("https", "http");
function protocolRegex($array){
if(empty($array)) { return "(\/\/)"; }
foreach($array as $i => $v){
if(empty($v)){
unset($array[$i]);
<?php
/**
* Function Switch
* Call the Funciton acording to the True or False Value.
* If any more Paramiters are passed after the first 3
* they are passed as paramiters for the called funciton.
*
* @param boolean The Selection of the Funciton to execute.
@nhalstead
nhalstead / createKey.php
Last active February 9, 2018 17:46
Generate Keys with Delimiter characters to whatever you want or let it figure that out for you! With this you get the Key back with the hash for the key to store in your database!
<?php
/**
* Create Key Function
* Generate a Key that you need with a specific length and a split character.
*
* @param Int Length of the Key, Total Length
* @param Int|Boolean If False, Disabled (default) and the int will provide the spacing for the char.
* @param Char|String The Separation Character for the Key every x characters.
* @return Array Return of 'key' and 'hash' and 'hash_delimiter'
@nhalstead
nhalstead / SocketLive.html
Last active February 12, 2018 01:20
Connecting to a Local Websocket with an Indicator on it.
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js"></script>
<meta charset="UTF-8">
<style>
html {
font: 12px/1.2em sans-serif;
}
ul {