Skip to content

Instantly share code, notes, and snippets.

<?php
/*
This is a fork of https://gist.github.com/frzsombor/ddd0e11f93885060ef35
Thanks frzsombor!
|--------------------------------------------------------------------------
| Checking the Sentry Auth for CKFinder CheckAuthentication
|--------------------------------------------------------------------------
| Put in the CKFinder config.php within the CheckAuthentication() function.
|
@ganey
ganey / phpversion.sh
Last active October 31, 2019 09:04 — forked from vjandrea/phpversion.sh
Change php cli version in plesk
#!/bin/sh
printf "Switching php to version 7.1 with symlinks.\n"
printf "Press any key to continue...\n"
read CONTINUE
printf "Creating backups..."
# Backup original binaries
@ganey
ganey / htmlentity.js
Created September 26, 2016 08:50 — forked from CatTail/htmlentity.js
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
@ganey
ganey / LogAfterRequest.php
Created October 13, 2016 09:59 — forked from Shelob9/LogAfterRequest.php
Log all request to Laravel app. Based on http://blog.phakeapps.com/2015/06/23/log-every-request-and-response-in-laravel-5/ updated for Laravel 5.3
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}
@ganey
ganey / backlight.sh
Created April 2, 2018 21:20 — forked from Everlanders/backlight.sh
Script to Change the Backlight brightness on the Official Raspberry Pi 7" display.
#!/bin/bash
level=$1
#echo "level given is $level"
if [ $# != 1 ]; then
echo "USAGE: $0 brightness_level (0 to 255)"
exit 1
fi
@ganey
ganey / ButtonMonitor.py
Created April 2, 2018 21:20 — forked from Everlanders/ButtonMonitor.py
Python Script to monitor GPIO button presses and call the Camera and Backlight.
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import subprocess, os
import signal
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
RearView_Switch = 14 # pin 18
Brightness_Switch = 15 # pin 16
@ganey
ganey / InputMask.html
Created July 30, 2018 11:57 — forked from codinronan/InputMask.html
Custom Ionic 2 & 3 Input Mask Directive
<ion-input type="tel" pattern="\d*" placeholder="(xxx) xxx-xxxx" mask="(***) ***-****" [(ngModel)]="phone" name="phone"></ion-input>
<ion-input type="tel" pattern="\d*" placeholder="xxx-xx-xxxx" mask="***-**-****" [(ngModel)]="ssn" name="ssn"></ion-input>
@ganey
ganey / workspace.sh
Last active January 22, 2019 10:45 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-bundle-image
WORKSPACE=~/Documents/workspace.dmg.sparsebundle
create() {
hdiutil create -type SPARSEBUNDLE -fs 'Case-sensitive APFS - APFS (Case-sensitive)' -size 100g -volname workspace ${WORKSPACE}
}
detach() {
@ganey
ganey / App_Http_VideoStream.php
Created December 15, 2019 15:28 — forked from vluzrmos/App_Http_VideoStream.php
Laravel VideoStream.
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";