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 | |
spl_autoload_register(function ($class) { | |
include_once 'core' . DS . strtolower($class) . '.php'; | |
}); |
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
RewriteEngine on | |
RewriteRule ^(.+)\.php$ /$1 [R,L] | |
RewriteCond %{REQUEST_FILENAME}.php -f | |
RewriteRule ^(.*?)/?$ /$1.php [NC,END] |
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 | |
$url = 'https://api.ipify.org/?format=json'; | |
$ip = '129.146.70.253:80'; | |
$request = curl_init(); | |
curl_setopt_array($request, [ | |
CURLOPT_URL => $url, | |
CURLOPT_PROXY => $ip, |
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 | |
/* https://github.com/paquettg/php-html-parser */ | |
public static function get_content(string $html_identity, string $needed_attribute, $source_html) | |
{ | |
$dom = new \PHPHtmlParser\Dom; | |
$dom->load($source_html); | |
$array_content = []; | |
foreach ($dom->find($html_identity) as $content) |
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 | |
// test case in https://www.hackerrank.com/challenges/linkedin-practice-caesar-cipher/problem | |
$input = 'DNFjxo?b5h*5<LWbgs6?V5{3M].1hG)pv1VWq4(!][DZ3G)riSJ.CmUj9]7Gzl?VyeJ2dIPEW4GYW*scT8(vhu9wCr]q!7eyaoy.'; | |
$step = 45; | |
foreach (range('a', 'z') as $value) | |
{ |
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
<!DOCTYPE html> | |
<html dir="ltr"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"> | |
<meta name="version" content="67d4b4487791dd9ee647028f7e531028b68abe9e"> | |
<meta name="fragment" content="!"> | |
<meta name="referrer" content="origin"> | |
<title>Flipboard: News for our time</title> |
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews -Indexes | |
</IfModule> | |
RewriteEngine On | |
# Handle Authorization Header | |
RewriteCond %{HTTP:Authorization} . | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |
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 | |
$limit = config('custom.config.appPerPage'); | |
$offset = ($page > 1) ? (($page - 1) * $limit) : 0; | |
$apps = App::where('publish', 1)->orderBy('updated_at', 'desc')->take($limit)->skip($offset)->get(); |
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 | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateUsersTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
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 | |
$ip = '77.37.130.187:38578'; | |
$url = 'https://api.ipify.org'; // https://api.ipify.org/?format=json | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_PROXY, $ip); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 2); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |