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
; ... | |
; Tag: xdebug, php, zend, xampp, netbeans | |
[XDebug] | |
zend_extension = "X:/xampp/php/ext/php_xdebug.dll" | |
zend_extension_ts = "X:/xampp/php/ext/php_xdebug.dll" | |
xdebug.profiler_append = 0 | |
xdebug.profiler_enable = 1 | |
xdebug.profiler_enable_trigger = 0 | |
xdebug.profiler_output_dir = "X:/xampp/tmp" |
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
:: https://superuser.com/questions/683021/how-to-get-the-command-that-invoked-a-task-with-tasklist/683052#683052 | |
wmic process where caption="test.exe" get commandline,processid |
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
// ... | |
/* Scroll to a view */ | |
View view = errorViews.get(0); | |
View parent = mSvContent; | |
View parentTemp; | |
int y = 0; | |
for (; ; ) { | |
parentTemp = (View) view.getParent(); | |
y += parentTemp.getTop(); |
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
; ... | |
; Security | |
; | |
; The Fast Track to Safe and Secure PHP Sessions | |
; https://paragonie.com/blog/2015/04/fast-track-safe-and-secure-php-sessions | |
; | |
; http://www.slideshare.net/mikestowe/intro-to-php-security-12564855/7-All_it_takes_is_one | |
; | |
; Note: |
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 | |
// | |
$filepath = 'file.txt'; | |
/** | |
"htm" => "text/html", | |
"exe" => "application/octet-stream", | |
"zip" => "application/zip", | |
"doc" => "application/msword", |
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
$fio = finfo_open(FILEINFO_MIME_TYPE); | |
$fif = finfo_file($fio, $path); | |
$ct = $fif; | |
$fio = finfo_open(FILEINFO_MIME_ENCODING); | |
$fif = finfo_file($fio, $path); | |
$cte = $fif; | |
//$fn = basename($path); |
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
public class CaUtil { | |
private static final String TAG = "Tag.CaUtil"; | |
public static String getCaString(Context context) { | |
try { | |
/* Get certificate string (for HTTPS connection) */ | |
InputStream caInput = new BufferedInputStream(context.getAssets().open("customCA.crt")); | |
InputStreamReader inputStreamReader = new InputStreamReader(caInput); | |
BufferedReader bufferedReader = new BufferedReader(inputStreamReader); |
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
$length = 32; | |
$str_bytes = openssl_random_pseudo_bytes($length); | |
$csrf_token_new = base64_encode($str_bytes); | |
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
/* Generate expires date (1 day) */ | |
$timezone_identifier = 'Asia/Makassar'; | |
date_default_timezone_set($timezone_identifier); | |
$time = '1 day'; | |
$interval = DateInterval::createFromDateString($time); | |
$dt = new DateTime(); | |
$dt->add($interval); | |
$format = 'Y-m-d H:i:s'; | |
$dt_str = $dt->format($format); |
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
// https://stackoverflow.com/questions/6287903/how-to-properly-add-csrf-token-using-php/31683058#31683058 | |
// Generating a CSRF Token (PHP 7) | |
$_SESSION['token'] = bin2hex(random_bytes(32)); | |
OlderNewer