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
/* When the width is between 600px and 900px OR above 1100px - change the appearance of <div> */ | |
@media screen and (max-width: 900px) and (min-width: 600px), (min-width: 1100px) { | |
div.example { | |
font-size: 50px; | |
padding: 50px; | |
border: 8px solid black; | |
background: yellow; | |
} | |
} |
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
(onclick="[^"]+")|(onclick='[^"]+') |
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
/* An array of objects containing date ranges (dd/mm/yyyy). | |
* Days and months should NOT be prefixed with zero (e.g. 02/06). | |
* NOTE: Make sure dates are not overlapping, or the script will probably fail. | |
* Usage: <div id="dates"></div> | |
*/ | |
var dates = [{ | |
"id": 1, | |
"from": "1/11/2017", | |
"to": "1/1/2018", | |
"schedule": "<p>Message here</p>" |
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
function ImgError(source){ | |
source.src = "https://www.google.dk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"; | |
source.onerror = ""; | |
return true; | |
} | |
/* Usage: | |
// <img src="http://example.com/img/noImg.jpg" alt="" onerror="ImgError(this)" /> | |
*/ |
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 | |
// Function to scrape images from Instagram hashtag page. Dirty solution - may stop working at any time. | |
function scrape_insta_hash($tag) { | |
$insta_source = file_get_contents('https://www.instagram.com/explore/tags/'.$tag.'/'); | |
$shards = explode('window._sharedData = ', $insta_source); | |
$insta_json = explode(';</script>', $shards[1]); | |
$insta_array = json_decode($insta_json[0], TRUE); | |
return $insta_array; // this returns a lot things print it and see what else you need | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Google Maps Multiple Markers</title> | |
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY" type="text/javascript"></script> | |
<style> | |
#map { | |
height: 400px; |
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
<script> | |
$(document).ready(function() { | |
var $displaylimit = 20; | |
gettwitterjson(); | |
function gettwitterjson() { | |
var $url = "twitter.php"; | |
$.ajax({ | |
url: $url, | |
type: 'GET', |
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
$("#btn_get_repos").click(function() { | |
$.ajax({ | |
type: "GET", | |
url: "https://api.github.com/users/google/repos", | |
dataType: "json", | |
success: function(result) { | |
for( i in result ) { | |
$("#repo_list").append( | |
"<li><a href='" + result[i].html_url + "' target='_blank'>" + | |
result[i].name + "</a></li>" |
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 | |
// for example your user | |
$user = 'xxxxxxx'; | |
// A token that you could generate from your own github | |
// go here https://github.com/settings/applications and create a token | |
// then replace the next string | |
$token = 'ced38b0e522a5c5e8ab10'; | |
// Generate the url for curl |
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
// An array of objects containing date ranges (dd/mm/yyyy) | |
var dates = [{ | |
"id": 1, | |
"from": "2/12/2016", | |
"to": "8/12/2016", | |
"schedule": "Opening hours: 9-5" | |
}, { | |
"id": 2, | |
"from": "11/10/2017", | |
"to": "16/10/2017", |