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
./ngrok http -host-header=rewrite myname.test:80 |
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
$.fn.form = function() { | |
var formData = {}; | |
this.find('[name]').each(function() { | |
formData[this.name] = this.value; | |
}) | |
return formData; | |
}; | |
var formData = $('#form').form(); |
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
$now = strtotime(date("Y-m-d 00:00:01")); | |
$nextFriday = strtotime('next friday midnight'); | |
$difff = $nextFriday - $now; | |
$diff = floor($difff / (60 * 60 * 24)); | |
$daysLeft = ($diff == 1) ? $diff.' day' : $diff.' days'; | |
echo 'Next delivery will be on Friday, '.date('d.m.Y', $nextFriday).'. '.$daysLeft.' left till delivery.'; |
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 | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$code = file_get_contents('https://ipapi.co/'.$ip.'/country/'); | |
$bannedCountries = ['IT', 'AU', 'MY', 'HK']; //Replace with your countries | |
if (in_array($code, $bannedCountries)) { | |
die('No access'); |
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
git archive --output=test_zip.zip HEAD $(git diff --name-only HASH1 HASH2) |
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 | |
/************************************************************************ | |
* Example Nested For VC | |
* vc_map() stuff should only be included when VC is enabled. | |
* | |
* This is just for a copy/paste test purpose. | |
*************************************************************************/ |
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
var $products = $('.list li'); | |
$('#filter').keyup(function() { | |
var re = new RegExp($(this).val(), "i"); // "i" means it's case-insensitive | |
$products.show().filter(function() { | |
return !re.test($(this).text()); | |
}).hide(); | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<!-- Quitar los slash '/' del final de la ruta --> | |
<rule name="RewriteRequestsToPublic"> | |
<match url="^(.*)$" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
</conditions> |
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 function geocode(array $address) | |
{ | |
$address = urlencode(implode(', ', $address)); | |
$url = sprintf('https://maps.googleapis.com/maps/api/geocode/json?address=%s&key=%s', $address, 'YOUR-KEY'); | |
$data = @file_get_contents($url); | |
$data = json_decode($data, true); | |
// If the json data is invalid, return empty array |
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 | |
/** | |
* Created by PhpStorm. | |
* User: mtonev | |
* Date: 10/14/15 | |
* Time: 11:01 AM | |
*/ | |
class FTP { | |
NewerOlder