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 | |
$model = $model->leftJoin('history', function ($join) { | |
$join->on('history.record_id', '=', 'work_order.work_order_id'); | |
$join->where('history.tablename', '=', 'test'); | |
$join->where('history.columnname', '=', 'column'); | |
$join->where(DB::raw('(`history`.`value_from` = 0 or `history`.`value_from` = "")'), '', ''); | |
$join->where('history.value_to', '>', '0'); | |
}); |
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 if (($wp_query->current_post +1) == ($wp_query->post_count)) { | |
echo 'This is the last post'; | |
} ?> | |
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) { | |
echo 'This is the not the last post'; | |
} ?> |
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
<div id="unique-id" style="display:none;"> | |
<div class="popover-heading">This is a heading</div> | |
<div class="popover-body">This is HTML content that will be loaded inside a </div> | |
</div> | |
<span tabindex="0" role="button" data-toggle="popover" data-placement="bottom" data-popover-content="#unique-id"> | |
Click me to load a popover | |
</span> |
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
/* | |
Template literals forEach example | |
Using Array.map(), we can create a forEach within template literals. | |
*/ | |
var items = [ | |
{ name: 'Teddy' }, | |
{ name: 'Dolores' }, | |
{ name: 'William' }, | |
{ name: 'Bernard' } |
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 | |
// GET | |
$request = $client->get($url, array('Accept' => 'application/json')); | |
$response = $request->send(); | |
if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { | |
// Error | |
} |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
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
/* | |
* Companion code for article at http://toddhayton.com/2018/08/01/scraping-with-puppeteer/ | |
* | |
* Setup: | |
* $ mkdir scraper/ | |
* $ cd scraper/ | |
* $ npm init -y | |
* $ npm install puppeteer --save | |
* | |
* Usage: |
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 | |
/* | |
Template Name: Kontakt | |
*/ | |
?> | |
<?php /* other template code goes here... */ ?> | |
<?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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
OlderNewer