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 | |
$local_file = 'assets/info_system/rss_feeds/feed.xml'; | |
$result = file_get_contents($local_file); | |
$xml = simplexml_load_string($result); | |
$xml->registerXPathNamespace('yweather', 'http://xml.weather.yahoo.com/ns/rss/1.0'); | |
$location = $xml->channel->xpath('yweather:location'); | |
if(!empty($location)) { |
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
var navElem = '.navigation-list.top-level'; | |
$('.toggle-mobile-nav').click(function(event) { | |
event.preventDefault() | |
$(navElem).toggle(); | |
}); | |
$('.top-level-item.dropdown').click(function(event) { | |
event.preventDefault(); | |
console.log('clicked'); | |
$('.level-1').hide(); |
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
(function ( $ ) { | |
'use strict'; | |
$.slider = function( element, options ) { | |
this.options = {}; | |
this.el = $(element); | |
// Public functions | |
this.init = function(element, options) { | |
var self = this; |
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
(function () { | |
var apollo = {}; | |
apollo.hasClass = function (elem, className) { | |
return elem.classList.contains(className); | |
}; | |
apollo.addClass = function (elem, className) { | |
elem.classList.add(className); |
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
<!-- The background that prevents the user from doing anything unwanted --> | |
<div class="overlayPanel"></div> | |
<!-- | |
The modal itself | |
This will give you a basic modal with a fixed width | |
--> | |
<div class="modal"> | |
<header class="modal-head"> | |
... |
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
/** | |
* Checking whether a number has the correct unit | |
* @var $number [number] The number (with the unit) that you want to check against. E.g 35px | |
* @var $unit [string] The unit that you need to know exists. E.g 'px' | |
* @return [boolean] | |
*/ | |
@function check-unit($number, $unit) { | |
@if $number != '' and unit($number) == $unit { | |
@return true; | |
} @else { |
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> | |
<head> | |
<style type="text/css"> | |
</style> | |
</head> | |
<body> | |
<b>Returns Confirmation</b> |
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
function generateSlug($inputString, $spacer = '-') | |
{ | |
$inputString = strtolower($inputString); | |
$inputString = str_replace(' ', $spacer, $inputString); | |
$inputString = preg_replace('/[^A-Za-z0-9-]/', '', $inputString); | |
$inputString = str_replace($spacer.$spacer, $spacer, $inputString); | |
return $inputString; | |
} |
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
$query = DB::table(DB::raw(' | |
(SELECT | |
SupplierProduct.discontinued, | |
SupplierProduct.productID, | |
InstSupplier.*, | |
max(stockLevel) as stockLevel | |
FROM | |
SupplierProduct | |
JOIN InstSupplier ON SupplierProduct.supplierID = InstSupplier.supplierID AND InstSupplier.installationID = ? AND InstSupplier.active = 1 | |
LEFT JOIN SupplierStock ON SupplierStock.supplierProductID = SupplierProduct.id |
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 | |
ini_set('max_execution_time', 600); // 10 minutes | |
class OptimiseImage | |
{ | |
private $baseDir = '/'; | |
private $inputDir = 'input'; | |
private $outputDir = 'output/large'; | |
private $tmpDir = 'tmp'; |
OlderNewer