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 | |
// assuming file.zip is in the same directory as the executing script. | |
$file = 'text.zip'; | |
// get the absolute path to $file | |
$path = pathinfo(realpath($file), PATHINFO_DIRNAME); | |
$zip = new ZipArchive; | |
$res = $zip->open($file); | |
if ($res === TRUE) { |
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
/bin/sh -c 'cd /home/public_html/project && /usr/bin/git fetch --all && /usr/bin/git reset --hard origin/master' 2>&1 | /home/timestap.sh >> /home/project_cronjob.log |
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 | |
# 1 | |
$rows = collect(['Administration', 'Samples', 'Test 1', 'Test 2',]); | |
# running filter on the collection, if true is returned from the callback then the element will remain the in collection. | |
$rows = $rows->filter(function($item){ | |
// dump($item); | |
# creating a collection, then checking with contains($item['name']) if the collection contains the item, using a ! at the start to not include the items which are in the checked collection. | |
return !collect(['Administration', 'Samples',])->contains($item['name']); |
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
// mimetype mp4, max is in kilobytes | |
mimetypes:video/mp4|max:15000 | |
// only images and max size of 500 KB | |
image|max:500 | |
// exists checks the attribute value in a table exists, format is: {table},{column} | |
required|exists:projects,id | |
// mimetypes for documents like word, powerpoint, excel and pdf with max filesize of 5000 KB |
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> | |
<title></title> | |
</head> | |
<body> | |
<video id="mejs_837308676760252_html5" controls="true" height="200" width="300"> | |
<source type="video/ogg" src="http://media.w3.org/2010/05/bunny/movie.ogv"> | |
<source type="video/mp4" src="http://media.w3.org/2010/05/bunny/movie.mp4"> |
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
https://www.php.net/manual/en/function.sys-getloadavg.php#118673 | |
Function to get current CPU load as percentage value under Windows and Linux. | |
Note: Function is getServerLoad(). It will return a decimal value as percentage of current CPU load or NULL if something went wrong (e. g. insufficient access rights). | |
<?php | |
header("Content-Type: text/plain"); |
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
// Put this inside bookmark | |
javascript:(function()%20{var%20protocol%20=%20window.location.protocol%20===%20'file:'%20?'http:'%20:%20'';var%20url%20=%20protocol+'//www.sprymedia.co.uk/VisualEvent/VisualEvent_Loader.js';if(%20typeof%20VisualEvent!='undefined'%20)%20{if%20(%20VisualEvent.instance%20!==%20null%20)%20{VisualEvent.close();}else%20{new%20VisualEvent();}}else%20{var%20n=document.createElement('script');n.setAttribute('language','JavaScript');n.setAttribute('src',url+'?rand='+new%20Date().getTime());document.body.appendChild(n);}})(); |
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
$(document).ready(function() { | |
$('body,html').animate({scrollTop: 550}, 1500); | |
}); |
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="menuBar" class="nav-menu"></div> | |
<div style="margin-bottom: 999em;"></div> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$(window).on('scroll', function () { | |
var $body = $('body'); | |
var $target = $('#menuBar'); | |
if ($body.scrollTop() > 100 && $target.hasClass('nav-menu')){ |
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
// Define your target div / popup container here. | |
var popup_target = '#checkout_open'; | |
// Call the function like this | |
// jQuery("#checkout_open").center(); | |
// Attach a function to jQuery | |
jQuery.fn.center = function () { | |
this.css("position","absolute"); |