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
function ConvertTo-PascalCase | |
{ | |
[OutputType('System.String')] | |
param( | |
[Parameter(Position=0)] | |
[string] $Value | |
) | |
# https://devblogs.microsoft.com/oldnewthing/20190909-00/?p=102844 | |
return [regex]::replace($Value.ToLower(), '(^|_)(.)', { $args[0].Groups[2].Value.ToUpper()}) |
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 | |
/** | |
* A simple function that uses mtime to delete files older than a given age (in seconds) | |
* Very handy to rotate backup or log files, for example... | |
* | |
* $dir String whhere the files are | |
* $max_age Int in seconds | |
* return String[] the list of deleted files | |
*/ |
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
# MySQL Server Instance Configuration File | |
# ---------------------------------------------------------------------- | |
# Generated by the MySQL Server Instance Configuration Wizard | |
# | |
# | |
# Installation Instructions | |
# ---------------------------------------------------------------------- | |
# | |
# On Linux you can copy this file to /etc/my.cnf to set global options, | |
# mysql-data-dir/my.cnf to set server-specific options |
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
Windows Registry Editor Version 5.00 | |
; This will handle right clicking on a file | |
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code] | |
@="Edit with VS Code" | |
"Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0" | |
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] | |
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\"" |
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
function componentToHex(c) { | |
var hex = c.toString(16); | |
return hex.length == 1 ? "0" + hex : hex; | |
} | |
function rgbToHex(r, g, b) { | |
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); | |
} | |
function hexToRgb(hex) { |
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 | |
/** | |
* ------------------------------------------------------------------------------------- | |
* Written on - 13-June-2018 14:30:00 | |
* Wtirren By - Mukesh Patel (http://patelworld.in) | (http://facebook.com/patelnwd) | |
* ===================================================================================== | |
* | |
* This Class is written for Process Background Process. | |
* Most of cases we saw we need to execute some process without user interaction, |
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 | |
function percentile_as_excel($data, $percentile){ | |
if( 0 <= $percentile && $percentile <= 1 ) { | |
$p = $percentile; | |
}else { | |
return ""; | |
} | |
$count = count($data); | |
$allindex = ($count-1)*$p; | |
$intvalindex = intval($allindex); |