A Pen by Stoyan Miladinov on CodePen.
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 | |
// URL til varselet | |
$url = 'http://www.yr.no/sted/Norge/Hordaland/Bergen/Bergen/varsel.xml'; | |
// Les data fra URL | |
$xmldata = file_get_contents($url); | |
// Les dataene og gjør om til SimpleXML-objekt | |
$xml = new SimpleXMLElement($xmldata); |
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: Paul Irish - Comprehensive List of Browser-Specific CSS Hacks | |
* http://paulirish.com/2009/browser-specific-css-hacks/ | |
**/ | |
/***** Selector Hacks ******/ | |
/* IE6 and below */ | |
* html #uno { color: red } | |
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 o = $( {} ); | |
$.subscribe = o.on.bind(o); | |
$.unsubscribe = 0.off.bind(o); | |
$.publish = o.trigger.bind(o); |
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
.ir { | |
border: 0; | |
font: 0/0 a; | |
text-shadow: none; | |
color: transparent; | |
background-color: transparent; | |
} |
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($) { | |
var o = $( {} ); | |
$.each({ | |
on: 'subscribe', | |
trigger: 'publish', | |
off: 'unsubscribe' | |
}, function( key, api ) { | |
$[api] = function() { | |
o[key].apply( o, arguments ); |
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
<section> | |
<div class="module"></div> | |
<div class="module"></div> | |
<div class="module"></div> | |
<div class="module"></div> | |
<div class="module"></div> | |
<div class="module"></div> | |
<div class="module"></div> | |
<div class="module"></div> |
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
document.getElementById("myLink").addEventListener("click", function(e) { | |
// e.preventDefault(); (bad) | |
if(e.meta || e.ctrlKey) return; // Don't block user if they want to open a new tab | |
e.preventDefault(); | |
}); |
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 | |
// Found at http://www.php.net/manual/en/class.dateperiod.php | |
// Credit goes to jkaatz at gmx dot de | |
// ************************************************ | |
// Nice example from PHP Spring Conference (thanks to Johannes Schlüter and David Zülke) | |
$begin = new DateTime('2013-05-01 00:00:00'); | |
$end = new DateTime('2013-12-31 23:59:59'); |
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 | |
use Guzzle\Http\Client, | |
Guzzle\Common\Exception\MultiTransferException; | |
$client = new Client('http://graph.facebook.com'); | |
try { | |
$responses = $client->send(array( | |
$client->get('/' . urlencode('http://tech.vg.no')), | |
$client->get('/' . urlencode('http://www.vg.no')), |
OlderNewer