Skip to content

Instantly share code, notes, and snippets.

View pariz's full-sized avatar

Pär Karlsson pariz

View GitHub Profile
'use strict'
var context = SP.ClientContext.get_current();
var user = context.get_web().get_currentUser();
var hostUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
var appWebUrl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
var PeopleID = '';
$(document).ready(function() {
ExecuteOrDelayUntilScriptLoaded(StartThread, "sp.js");
});
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 86400 seconds"
ExpiresByType text/javascript "access plus 86400 seconds"
ExpiresByType application/javascript "access plus 86400 seconds"
ExpiresByType application/x-javascript "access plus 86400 seconds"
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\\.(css)$">
@pariz
pariz / gist:d9aaaf081296b5df578b
Last active August 29, 2015 14:08
Setting dynamic tables via model
class TestModel extends Eloquent {
public static function dynamicTable($table) {
$instance = new static;
$instance->setTable($table);
return $instance;
}
<?php
$xml = simplexml_load_file('http://www.yr.no/sted/Sverige/Uppsala/Storvreta/forecast.xml');
$xpath = $xml->xpath('/weatherdata/forecast/tabular/time[1]/temperature/@value');
var_dump((string)$xpath[0]);