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> | |
<head> | |
<meta charset="utf-8"> | |
<h1>Tågtider API - Exempel</h1> | |
<pre><?php | |
// Setup | |
$url = 'http://api.tagtider.net/v1/stations.json'; | |
$key = 'tagtider'; | |
$secret = 'codemocracy'; |
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
/** | |
* Basic call method for setting and removing object properties | |
* | |
* @param String $method | |
* @param Array $args | |
* | |
* @return Mixed | |
* | |
* @access public | |
*/ |
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 | |
/** | |
* Validate JSONP Callback | |
* | |
* https://github.com/tav/scripts/blob/master/validate_jsonp.py | |
* https://github.com/talis/jsonp-validator/blob/master/src/main/java/com/talis/jsonp/JsonpCallbackValidator.java | |
* http://tav.espians.com/sanitising-jsonp-callback-identifiers-for-security.html | |
* http://news.ycombinator.com/item?id=809291 | |
* |
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><meta charset="UTF-8" /><title>Trafikverket exponerar API</title></head><body><pre><?php | |
/** | |
* @author Erik Eng <erik@eng.se> | |
* | |
* @url http://tagtider.net/blogg/tjanster/trafikverket-exponerar-api/ | |
* | |
*/ | |
$headers = array( |
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
/** | |
* YN string to dates | |
* | |
* @param string $from | |
* @param string $to | |
* @param string $yn | |
* | |
* @return array $dates | |
*/ | |
function ynToDates($from, $to, $yn) |
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 | |
/** | |
* Seconds since midnight to date | |
* | |
* @param string $date | |
* @param int $seconds | |
* | |
* @return string | |
*/ |
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 | |
/** | |
* Resize Image Class | |
* | |
* @author Erik Pettersson <mail@ptz0n.se> | |
* @copyright 2011 Erik Pettersson <mail@ptz0n.se> | |
* @license http://www.opensource.org/licenses/mit-license.php MIT | |
*/ | |
class Image { |
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 | |
/** | |
* Convert coordinates with projection | |
* | |
* @param string $easting X coordinate | |
* @param string $northing Y coordinate | |
* @param string $projection | |
* | |
* @return array |
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 | |
/** | |
* Merge two dimensional arrays my way | |
* | |
* Will merge keys even if they are of type int | |
* | |
* @param array $array1 Initial array to merge. | |
* @param array ... Variable list of arrays to recursively merge. | |
* |
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
@mixin respond-to($media) { | |
@if $media == landscape { | |
@media screen and (min-width: 321px) { @content; } | |
} | |
@else if $media == tablet { | |
@media only screen and (min-width: 768px) { @content; } | |
} | |
@else if $media == desktop { | |
@media only screen and (min-width: 992px) { @content; } | |
} |
OlderNewer