This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License: MIT - https://opensource.org/licenses/MIT | |
// Author: Michele Locati <michele@locati.it> | |
// Source: https://gist.github.com/mlocati/7210513 | |
function perc2color(perc) { | |
var r, g, b = 0; | |
if(perc < 50) { | |
r = 255; | |
g = Math.round(5.1 * perc); | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('interface_exists')) { | |
die('PHP version too old'); | |
} | |
$throwables = listThrowableClasses(); | |
$throwablesPerParent = splitInParents($throwables); | |
printTree($throwablesPerParent); | |
if (count($throwablesPerParent) !== 0) { | |
die('ERROR!!!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
call :setESC | |
cls | |
echo %ESC%[101;93m STYLES %ESC%[0m | |
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m | |
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m | |
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _WIN32_WINNT 0x0600 | |
#include <stdio.h> | |
#include <windows.h> | |
#include <fileapi.h> | |
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING | |
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Attach release asset | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
attach_release_asset: | |
name: Attach release asset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Save this file as /application/bootstrap/app.php | |
if (!function_exists('fnmatch')) { | |
// Shim for fnmatch | |
// Code from https://www.php.net/manual/en/function.fnmatch.php#100207 | |
define('FNM_PATHNAME', 1); | |
define('FNM_NOESCAPE', 2); | |
define('FNM_PERIOD', 4); | |
define('FNM_CASEFOLD', 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
rem Reference: https://wiki.php.net/internals/windows/stepbystepbuild | |
set MY_VSDIR=C:\Path\To\Microsoft Visual Studio 14.0 | |
set PATH=%SystemRoot%\System32 | |
echo # Compiling PHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -o errexit | |
set -o nounset | |
printf -- '- cleanup... ' | |
rm -rf ./tmp | |
mkdir ./tmp | |
echo 'done.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_error_handler( | |
static function ($errno, $errstr, $errfile, $errline) | |
{ | |
$message = trim((string) $errstr); | |
if ($message === '') { | |
$message = "Unknown error (code: {$errno})"; | |
} | |
if ($errfile) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
const FIX_EOL = true; | |
const FIX_BOM = true; | |
set_error_handler( | |
static function ($errno, $errmsg, $errfile, $errline) | |
{ | |
throw new RuntimeException("Error {$errno}: {$errmsg}\nFile: {$errfile}\nLine: {$errline}"); |
NewerOlder