Skip to content

Instantly share code, notes, and snippets.

View mladoux's full-sized avatar

Mark LaDoux mladoux

View GitHub Profile
@mladoux
mladoux / OpenWithSublimeText3.bat
Last active January 3, 2016 04:19 — forked from mrchief/LICENSE.md
Adds "Open with Sublime Text 3" explorer context item for both directories and files, rather than for files only as is default.
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
Section "InputClass"
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "TapButton3" "2"
Option "VertEdgeScroll" "off"
Option "VertTwoFingerScroll" "on"
Option "HorizEdgeScroll" "off"
### 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:

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:

@mladoux
mladoux / printnl.py
Last active November 7, 2017 06:18
Print multiple newlines
def printnl(lines=1):
'''Print a variable number of empty lines to the screen
Keyword arguments:
lines -- Number of empty lines to print.
Defaults to 1.
Returns: string
@mladoux
mladoux / SystemLoader.php
Created August 26, 2018 21:06
SystemLoader - A very simplle PHP class autoloader. Does not work with underscored class path conventions, but could easilly be modified to do so.
<?php
/**
* SystemLoader
*
* Autoloader for project libs and dependencies.
*
* @author Mark LaDoux <mark.ladoux@gmail.com>
*/
class SystemLoader
{
@mladoux
mladoux / routes.php
Last active November 23, 2018 17:40 — forked from geggleto/index.php
Slim 3 Middleware - Force HTTPS
// 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 / URI.php
Created December 25, 2018 20:13
URI Parser for DoomHamster Media Group ( Remove namespace from top of script if not using namespaces )
<?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 / ls-octal.sh
Created December 25, 2018 21:38
Get octal output from ls using awk
#!/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 / auth.php
Created March 27, 2019 18:14
Simple authentication class. Does not handle permissions or anything like that. Just something put together real quick and dirty.
<?php
/**
* Auth
*
* Verifies authentication credentials
*
* @author Mark LaDoux <mark.ladoux@gmail.com>
*/
class Auth