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 of your document</title> | |
<meta charset="utf-8"> | |
<meta name="description" content=""> | |
</head> | |
<body> |
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://github.com/lsmith/addBusinessDays/blob/master/addBusinessDays.js | |
// var d = new Date(); | |
// addBusinessDays(d, numberOfDays); | |
function addBusinessDays(d,n) { | |
d = new Date(d.getTime()); | |
var day = d.getDay(); | |
d.setDate(d.getDate() + n + (day === 6 ? 2 : +!day) + (Math.floor((n - 1 + (day % 6 || 1)) / 5) * 2)); | |
return d; | |
} |
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
openssl base64 < path/to/file.png | tr -d '\n' | pbcopy |
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
try { | |
DB::connection()->getPdo()->beginTransaction(); | |
// database queries here | |
DB::connection()->getPdo()->commit(); | |
} catch (\PDOException $e) { | |
// Woopsy | |
DB::connection()->getPdo()->rollBack(); | |
} |
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
try { | |
DB::connection()->pdo->beginTransaction(); | |
// database queries here | |
DB::connection()->pdo->commit(); | |
} catch (\PDOException $e) { | |
// Woopsy | |
DB::connection()->pdo->rollBack(); | |
} |
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
<!-- SINGLE COLUMN LAYOUT --> | |
<div id="wrap"> | |
<header id="header"></header> | |
<section id="main"></section> | |
</div> | |
<footer id="footer"></footer> | |
<!-- MULTI COLUMN LAYOUT --> | |
<div id="wrap"> | |
<header id="header"></header> |
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 cursorFocus = function(elem) { | |
var x = window.scrollX, y = window.scrollY; | |
window.scrollTo(x, y); | |
elem.focus(); | |
} | |
cursorFocus(document.getelementbyId('search-terms')); |
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
<script> | |
showMap([ | |
{ | |
target: "map-canvas", | |
locations: [ | |
["Saved Home 1",-25.363882,131.040922], | |
["Saved Home 2",-25.363882,131.044922], | |
["Saved Home 3",-25.363882,131.048922], | |
["Saved Home 4",-25.363882,131.052922], | |
["Saved Home 5",-25.363882,131.056922], |
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
$doc = new DOMDocument(); | |
$doc->loadHTML($html); | |
$tags = $doc->getElementsByTagName('img'); | |
foreach ($tags as $tag) { | |
echo $tag->getAttribute('src'); | |
} |
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 getRealIpAddr() | |
{ | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) | |
//check ip from share internet | |
{ | |
$ip=$_SERVER['HTTP_CLIENT_IP']; | |
} | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) | |
//to check ip is pass from proxy | |
{ |
NewerOlder