This file contains hidden or 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 to calculate percentage without checking the divisor for zero. | |
* Also includes precision point | |
* | |
* @param $got | |
* @param $out | |
* @param int $precision | |
* @return float|int |
This file contains hidden or 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 to return the ordinal of any number | |
* E.g: number = 1 => Ordinal = st | |
* E.g: number = 23 => Ordinal = rd | |
* | |
* @param int $number | |
* @return string | |
*/ |
This file contains hidden or 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 | |
return [ | |
'AF' => 'Afghanistan', | |
'AX' => 'Aland Islands', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', | |
'AO' => 'Angola', |
This file contains hidden or 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 | |
return [ | |
'AP' => 'Andhra Pradesh', | |
'AR' => 'Arunachal Pradesh', | |
'AS' => 'Assam', | |
'BR' => 'Bihar', | |
'CT' => 'Chhattisgarh', | |
'GA' => 'Goa', | |
'GJ' => 'Gujarat', |
This file contains hidden or 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 arrayToCommaSeperatedString($arr,$key=null){ | |
$str = ''; | |
if(is_null($key)) | |
return $str; | |
foreach($arr as $arr_ele){ | |
$str .= $$arr_ele[$key].", "; |
This file contains hidden or 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 | |
/** | |
* Code Snippet for Strong Password Generation | |
* | |
* @param int $length | |
* @param bool|false $add_dashes | |
* @param string $available_sets | |
* @return string | |
*/ | |
function generateStrongPassword($length = 9, $add_dashes = false, $available_sets = 'luds') |
This file contains hidden or 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
npp_console 1 //open console | |
NPP_CONSOLE - //disable output of commands | |
npe_console m- //disable unnecessary output | |
con_colour bg= 191919 fg= F5F5F5 //set console colors | |
npp_save //save the file | |
cd $(CURRENT_DIRECTORY) //follow current directory | |
NPP_CONSOLE + //enable output | |
IF $(EXT_PART)==.c GOTO C //if .c file goto C label | |
IF $(EXT_PART)==.cpp GOTO CPP //if .cpp file goto CPP label | |
IF $(EXT_PART)==.java GOTO JAVA //if .java file goto JAVA label |
This file contains hidden or 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
/********************************************************* | |
.......................................................... | |
...SSSSSSS....HHHH...HHHH.HIIII.BBBBBBBBBB...UUUU...UUUU.. | |
..SSSSSSSSS...HHHH...HHHH.HIIII.BBBBBBBBBBB..UUUU...UUUU.. | |
..SSSSSSSSSS..HHHH...HHHH.HIIII.BBBBBBBBBBB..UUUU...UUUU.. | |
.SSSSS..SSSS..HHHH...HHHH.HIIII.BBBB...BBBB..UUUU...UUUU.. | |
.SSSSS........HHHH...HHHH.HIIII.BBBB...BBBB..UUUU...UUUU.. | |
..SSSSSSS.....HHHHHHHHHHH.HIIII.BBBBBBBBBBB..UUUU...UUUU.. | |
...SSSSSSSSS..HHHHHHHHHHH.HIIII.BBBBBBBBBB...UUUU...UUUU.. | |
.....SSSSSSS..HHHHHHHHHHH.HIIII.BBBBBBBBBBB..UUUU...UUUU.. |
This file contains hidden or 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
Set WshShell = CreateObject("WScript.Shell") | |
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")) | |
Function ConvertToKey(Key) | |
Const KeyOffset = 52 | |
i = 28 | |
Chars = "BCDFGHJKMPQRTVWXY2346789" | |
Do | |
Cur = 0 | |
x = 14 |
This file contains hidden or 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 | |
return [ | |
'Andhra Pradesh (AP)'=>[ | |
'Adilabad', | |
'Anantapur', | |
'Chittoor', | |
'Kakinada', | |
'Guntur', |
OlderNewer