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 | |
header('Access-Control-Allow-Origin: *'); | |
header("Content-Type: application/json; charset=utf-8"); | |
$url = htmlspecialchars($_GET['url']); | |
if ($url) { | |
$content = file_get_contents($url); | |
} else { | |
$content = 'error'; |
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
const puppeteer = require('puppeteer'); | |
const fs = require('fs'); | |
const util = require('util'); | |
// data | |
const rawdata = fs.readFileSync('plates.json'); | |
const textDecoder = new util.TextDecoder('utf-8'); | |
const stringData = textDecoder.decode(rawdata); | |
const objects = JSON.parse(stringData); | |
console.log(objects); |
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
.form-group.has-required {position:relative;} | |
.form-group.has-required:after { | |
content:'\f069'; | |
font-family:'FontAwesome'; | |
position:absolute; | |
top:1px; | |
right:1px; | |
padding:4px 7px; | |
text-align:center; | |
font-size:8px; |
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
//source: https://stackoverflow.com/a/5158301 | |
function getUrlParam(name) { | |
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.href); | |
return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); | |
} | |
//USAGE | |
//assumed url: http://example.com?page=3&sort=asc&perPage=20 | |
getUrlParam('page'); | |
getUrlParam('sort'); |
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
var today = moment(); | |
var tomorrow = moment().add(1, 'day'); | |
var isToday = function(input) { | |
return moment(input).isSame(today, 'day'); | |
}; | |
var isTomorrow = function(input) { | |
return moment(input).isSame(tomorrow, 'day'); | |
}; |
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
var dataWatcher = setInterval(function() { | |
var dataComplete = false; | |
if (dataCompleteGroups == true && dataCompleteEvents == true) { | |
dataComplete = true; | |
} | |
if (dataComplete) { | |
clearInterval(dataWatcher); | |
// do 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
/* Masonry */ | |
.masonry {column-count:1; column-gap:1.5em; margin:1.5em auto;} | |
.masonry .item {display:inline-block; margin:0 0 1em; width:100%;} | |
.masonry .item iframe {max-width:100%;} | |
/* Large (lg) and up */ | |
@media (min-width:992px) { | |
.masonry {column-count:2;} | |
} |
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
/* Bootstrap 4 Helper CSS */ | |
/* Add-on: Bootstrap 4, hidden-{breakpoint}-{up/down} */ | |
/* taken from Bootstrap 4, alpha 6 */ | |
.hidden-xs-up {display:none!important;} | |
@media (max-width:575px) { .hidden-xs-down {display:none!important;} } | |
@media (min-width:576px) { .hidden-sm-up {display:none!important;} } | |
@media (max-width:767px) { .hidden-sm-down {display:none!important;} } | |
@media (min-width:768px) { .hidden-md-up {display:none!important;} } | |
@media (max-width:991px) { .hidden-md-down {display:none!important;} } |
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
<style> | |
body:after {content:attr(data-content); | |
</style> | |
$('body').attr('data-content': 'changed body:after content') | |
<body data-content="body:after content"> | |
...content... | |
</body |
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
// random number, inputting botht the min and max number | |
function randomNum(from, to){ | |
return Math.floor(Math.random() * (to - from + 1) + from); | |
} | |
// Usage: randomNum(1, 100) | |
// random number, inputting only the max number | |
function randomNum(max) { | |
return Math.floor(Math.random() * max) + 1; |
NewerOlder