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 | |
/** | |
* Template loading function for CodeIgniter 3.x | |
* Location: application/core/MY_Loader.php | |
* Class MY_Loader | |
*/ | |
class MY_Loader extends CI_Loader | |
{ |
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
it |
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 | |
// imagine $imageIds is a get parameter with a comma seperated string of ID's | |
// Eample: http://localhost/download-zip?images=1,2,3,4 | |
Route::get("/download-zip", function ($images) { | |
$imageIds = explode(",", $images); | |
// This is an eloquent model |
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 | |
/* | |
Assuming that all the data is the same "form", we can simply grab the data from the request | |
and render it as HTML, then convert that HTML doument to a PDF using the DomPDF library. | |
*/ | |
// Grab the request data | |
$request = $_POST; |
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 | |
$anArray = [ | |
"stuff" => "stuff", | |
"stuff2" => "stuff", | |
"stuff3" => "stuff", | |
"stuff4" => "stuff", | |
]; |
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
$(".filters .filters__wrapper ul").on("click", "li", function () { | |
// Set clicked element as active | |
$(this).siblings().removeClass("active"); | |
$(this).toggleClass("active"); | |
// Get the class to filter by | |
var filterClass = $(this).data("filter").trim(); | |
// Get the grid this filter applies to (use data-grid="#some-id-here") |
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 | |
$retries = 0; | |
$maxRetries = 3; | |
// Should fail this amount of times | |
$failCounter = 5; | |
for($i = 0; $i < 10; $i++) { | |
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\Http\Middleware; | |
use App\User; | |
use Auth; | |
use Closure; | |
use HipsterJazzbo\Landlord\Facades\Landlord; | |
class TenantScope |
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\Http\Middleware; | |
use App\Tenant; | |
use Closure; | |
use HipsterJazzbo\Landlord\Facades\Landlord; | |
class TenantHostnameScope | |
{ |
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 | |
require_once "./vendor/autoload.php"; | |
$client = new Goutte\Client(); | |
$keywords = "helge sverre"; | |
$crawler = $client->request('GET', 'https://www.google.no/search?q=' . urlencode($keywords)); |
OlderNewer