Skip to content

Instantly share code, notes, and snippets.

Mark LaDoux mladoux

Block or report user

Report or block mladoux

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mladoux
mladoux / auth.php
Created Mar 27, 2019
Simple authentication class. Does not handle permissions or anything like that. Just something put together real quick and dirty.
View auth.php
<?php
/**
* Auth
*
* Verifies authentication credentials
*
* @author Mark LaDoux <mark.ladoux@gmail.com>
*/
class Auth
@mladoux
mladoux / ls-octal.sh
Created Dec 25, 2018
Get octal output from ls using awk
View ls-octal.sh
#!/bin/sh
ls -l | awk '{
k = 0
s = 0
for( i = 0; i <= 8; i++ )
{
k += ( ( substr( $1, i+2, 1 ) ~ /[rwxst]/ ) * 2 ^( 8 - i ) )
}
j = 4
@mladoux
mladoux / github-gist-monokai.css
Last active Dec 25, 2018
Monokai color scheme for gists ( with matching powered by github bar )
View github-gist-monokai.css
/* Monokai color Scheme Syntax Highlight Overrides ( REQUIRES 'body' TAGS TO WORK) */
body .gist .highlight {
background: #272822;
}
body .gist .blob-num,
body .gist .blob-code-inner,
body .gist .pl-s2,
body .gist .pl-stj {
color: #f8f8f2;
}
@mladoux
mladoux / github-gist-code-box.css
Last active Dec 25, 2018
Resize embedded gist code box and centers it. Adjust to taste.
View github-gist-code-box.css
/* Set width to 600px, and center box */
.gist {
margin-left: auto;
margin-right: auto;
width: 600px !important;
}
/* Limit height and width of script box, and enable scrollbars */
.gist-data {
height:250px;
@mladoux
mladoux / URI.php
Created Dec 25, 2018
URI Parser for DoomHamster Media Group ( Remove namespace from top of script if not using namespaces )
View URI.php
<?php namespace DHMedia\Input;
/**
* DHMedia URI Parser
*
* @author Mark LaDoux <mark.ladoux@gmail.com>
* @copyright Copyright © 2018, DoomHamster Media
* @license MIT <https://opensource.org/licenses/MIT>
*/
class URI
@mladoux
mladoux / routes.php
Last active Nov 23, 2018 — forked from geggleto/index.php
Slim 3 Middleware - Force HTTPS
View routes.php
// Enforce HTTPS
$app->add(function (Request $request, Response $response, $next) {
$cf = $this->get('settings');
// Check if configuration wants us to enforce https, so we can turn it
// on or off depending on whether the server supports https
if (isset($cf['force_https']) && $cf['force_https'] === true) {
if ($request->getUri()->getScheme() !== 'https') {
// Redirect to HTTPS
@mladoux
mladoux / SystemLoader.php
Created Aug 26, 2018
SystemLoader - A very simplle PHP class autoloader. Does not work with underscored class path conventions, but could easilly be modified to do so.
View SystemLoader.php
<?php
/**
* SystemLoader
*
* Autoloader for project libs and dependencies.
*
* @author Mark LaDoux <mark.ladoux@gmail.com>
*/
class SystemLoader
{
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

View GPG Public Key
### Keybase proof
I hereby claim:
* I am mladoux on github.
* I am mladoux (https://keybase.io/mladoux) on keybase.
* I have a public key ASAQbMlDtPPSVJ75uR84kO_lq87mt5zif76Zw6nW3sP_1wo
To claim this, I am signing this object:
View GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFm0TXsBEACUVILSA5HcE/bzTgyU3jgc4qLejlShchHLl306QrPT1V5UD7yr
Sn2Q42kov4lal3i0+UI7AFj301d3xVd6J6qecqIeCnEmcidzcK19tmtZw1bhyDbl
ssIaRA3epkOcyhKj9C9QGnH6W1QSi8i8rLscC82Y91wj7lBSn1gPgzVFbzlTRbfJ
pF7eaoN9iJCp7r5I+hGjWqXJ7jbHfaN+Vowl6jxc5TTIhFCuRJn86SQc+G8bvq0j
R2/66nJan5AUWCCQDQrxVWyVMLoJrSsflKCYbrIa8/GQHDuP4nmC049TnpbHaW7+
BofIKX8scxwDKMdvtOo6Gw0leCDu+a0l4NGk/uIKMynOdoRHgeFtt3WSM02PCL1x
LpE5ptDzVi6Ytkly8oyKoccqh+slgninY2AAXGixOATamqI6jpumqhv8FjiKeLHw
VOpkBK0cnwuFZRBNvEiNM9BcJ12LAX4GwctMuc9FKxAwQdyAESkM7GhZXdG/IuHj
You can’t perform that action at this time.