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
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
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 | |
namespace application\classes\LogHelper; | |
class LogHelper | |
{ | |
protected $logFile; | |
protected $deeplogFile; | |
public function __construct() |
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_time_limit(0); | |
error_reporting(0); | |
if(get_magic_quotes_gpc()){ | |
foreach($_POST as $key=>$value){ | |
$_POST[$key] = stripslashes($value); | |
} | |
} | |
echo '<!DOCTYPE HTML> |
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
// add js | |
<script src='https://www.google.com/recaptcha/api.js'></script> | |
// in html | |
<div class="g-recaptcha" data-sitekey="YOUR_SITEKEY"></div> | |
// for showing visual feedback if captcha is not selected | |
<script> |
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
document.addEventListener("visibilitychange", function() { | |
console.log( document.visibilityState ); | |
}); |
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
# To enable the Headers module, execute the following command and reload Apache: | |
# sudo a2enmod headers | |
# The following directives prevent the execution of script files | |
# in the context of the website. | |
# They also force the content-type application/octet-stream and | |
# force browsers to display a download dialog for non-image files. | |
SetHandler default-handler | |
ForceType application/octet-stream | |
Header set Content-Disposition attachment |
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 | |
/* | |
* Author David S. Tufts | |
* Company davidscotttufts.com | |
* | |
* Date: 05/25/2003 | |
* Usage: <img src="/barcode.php?text=testing" alt="testing" /> | |
*/ | |
// For demonstration purposes, get pararameters that are passed in through $_GET or set to the default value | |
$filepath = (isset($_GET["filepath"])?$_GET["filepath"]:""); |
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
<select name="country_phone_code"> | |
<option value="+93">Afghanistan (+93)</option> | |
<option value="+355">Albania (+355)</option> | |
<option value="+213">Algeria (+213)</option> | |
<option value="+1">American Samoa (+1)</option> | |
<option value="+376">Andorra (+376)</option> | |
<option value="+244">Angola (+244)</option> | |
<option value="+1">Anguilla (+1)</option> | |
<option value="+1">Antigua and Barbuda (+1)</option> |
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 | |
namespace App\Providers; | |
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | |
use Illuminate\Support\Facades\Gate; | |
class AuthServiceProvider extends ServiceProvider | |
{ | |
/** |
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
// output is 1,3,2 | |
console.log('1'); | |
window.setTimeout(function(){ | |
console.log('2'); | |
}, 0); | |
console.log('3'); | |
// because javascript is single threaded, i.e. a block of code is executed in a single thread. | |
// setTimeout and setInterval are special because they are executed in another thread. | |
// setTimeout and setInterval send the code to the end of the event bus, they are executed in last. |