Skip to content

Instantly share code, notes, and snippets.

View Archigos's full-sized avatar

AJ Phillips Archigos

  • Upstate New York
  • 00:21 (UTC -04:00)
View GitHub Profile
@Archigos
Archigos / htmlentities.html
Created April 9, 2016 02:45
Display HTML Entities with Javascript
<style>
html {
background-color: #CCCCCC;
}
#icons {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#icons > div {
@Archigos
Archigos / gist:fa4ea53177fc5d865a5e
Created July 13, 2015 20:48
Create 'Pretty' Error Pages inside projects
<?php
// Turn Off Displayed Errors
ini_set('display_errors', false);
// Handle Errors Our Way
// You Can Replace 'shutdown_handler' With Any Name, But
// Must Match Function Below
register_shutdown_function('shutdown_handler');
function shutdown_handler() {
@Archigos
Archigos / scrollbars.less
Created July 29, 2014 16:04
Customize Browser Scrollbars
::-webkit-scrollbar {
.square(5px);
&-track { background-color: @grayDark; .border-radius(5px); }
&-thumb { background-color: @gray; .border-radius(5px); }
&-button { background-color: transparent; height: 8px; }
&-corner { background-color: transparent; }
}
@Archigos
Archigos / func.redirect.php
Created July 29, 2014 16:00
Basic PHP Page Redirect
public function redirect($url,$sec=3) {
echo "Redirecting in $sec seconds";
echo "<meta http-equiv='refresh' content='$sec,url=$url'>";
}
/* Examples:
* redirect('http://google.com',5);
*/
@Archigos
Archigos / func.copyright.php
Created July 29, 2014 15:55
Auto Copyright Year
@Archigos
Archigos / class.makeErrors.php
Created July 29, 2014 15:47
Simple Error Creation Class
/* Simple Error Class */
class makeErrors {
protected $error;
public function __construct($error) {
$this->error = $error;
}
public function showError($error) {
if($error != NULL) {
throw new Exception($error);
}
@Archigos
Archigos / say.bat
Created July 29, 2014 15:36
Use speech in your scripts (See NirCmdCheck gist for more info)
@ECHO OFF && nircmd setsysvolume 65535
GOTO Beginning
:: Start Comment Block
Have speech notifications in other scripts. Please note, all speech must be
phonetic so you may have to 'fudge' some spelling to make it sound correct.
Example, working with IIS on Windows, you may need to reference the IUSR account
and to do it correctly you'd use something like this:
Say "File permissions reset for I user account"
@Archigos
Archigos / checkfile.bat
Created July 29, 2014 15:27
Get some basic information about a file
@ECHO OFF && SETLOCAL ENABLEEXTENSIONS && SETLOCAL ENABLEDELAYEDEXPANSION
TITLE %COMSPEC% && MODE CON COLS=200 LINES=68 && COLOR 07
PUSHD . && CLS
:: Test for Admin (Uncomment if you require them)
REM OPENFILES >NUL || ECHO Administrative Privileges Required
IF "%~1" == "/?" GOTO Help ELSE GOTO Beginning
IF "%~1" == "" GOTO Help
@Archigos
Archigos / NirCmdCheck.bat
Created July 29, 2014 15:25
Check if NirCmd.exe installed on system, asks to download if missing
@ECHO OFF && SETLOCAL ENABLEEXTENSIONS && SETLOCAL ENABLEDELAYEDEXPANSION
TITLE %COMSPEC% && MODE CON COLS=200 LINES=68 && COLOR 07
PUSHD . && CLS
TITLE NirCmd Test
IF "%~1" == "/?" GOTO Help
IF "%~1" == "" GOTO Beginning
:: This begins comment block
@Archigos
Archigos / progressbar.bat
Created July 29, 2014 15:20
Add a progress bar to you batch files
REM Supplemental Batch File
REM Use 'CALL progressbar XX' in other scripts (where XX is a number 0 - 100)
REM Example: CALL progressbar 50
@ECHO OFF
:ProgressMeter
SETLOCAL ENABLEDELAYEDEXPANSION
SET ProgressPercent=%1
SET /A NumBars=%ProgressPercent%/2