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
/** | |
Fetch from Weather | |
This fetches a JSON feed from the Weather system. | |
*/ | |
var weatherWidget = { | |
fetch: function ( locId ) { | |
var weatherForecastUrl = 'http://news.bbc.co.uk/weather/forecast/' + locId + '/Next3DaysJSON.json', | |
cachebusterStr = 'cachebuster=' + ( new Date().valueOf() ), |
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
locator.geo.getCurrentPosition( | |
function ( pos ) { | |
var lat = pos.coords.latitude, | |
lon = pos.coords.longitude; | |
// now use locator to search for a matching location | |
// in the gazetter | |
locator.searchByCoordinatesWithRadius( | |
lon, | |
lat, |
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 el; | |
var prefixes = ["Webkit", "Moz", "O"]; | |
// Test whether browser supports the given CSS property | |
// Name of CSS property to test must be in CamelCase i.e. borderRadius | |
function testProperty(prop) { | |
// create element to peform property detection against | |
el = el \|\| document.createElement("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
require(['carouselfactory'], function( cf ) { | |
cf.createCarousel('#mycarousel'); | |
}); |
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
define(['jquery-1'], function($){ | |
var attachedTo = [], | |
selector = '.toggle'; | |
function init() { | |
attachedTo = $(selector); | |
} | |
function destroy() { | |
attachedTo = []; |
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
// HACK: Is there a supported way of fetching all | |
// variables from the view? | |
// Used to propagate variables to subviews. | |
$viewData = $this->view->_spectrumViewData; | |
$this->view->assign("viewData", $viewData); |
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
~$ ifconfig | |
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 | |
inet6 ::1 prefixlen 128 | |
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 | |
inet 127.0.0.1 netmask 0xff000000 | |
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 | |
stf0: flags=0<> mtu 1280 | |
en0: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 | |
ether 70:cd:60:f2:05:3d | |
media: autoselect (none) |
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
~$ traceroute 192.168.192.10 | |
traceroute to 192.168.192.10 (192.168.192.10), 64 hops max, 52 byte packets | |
1 * * * | |
traceroute: sendto: No route to host | |
2 traceroute: wrote 192.168.192.10 52 chars, ret=-1 | |
*traceroute: sendto: Host is down | |
traceroute: wrote 192.168.192.10 52 chars, ret=-1 | |
*traceroute: sendto: Host is down | |
traceroute: wrote 192.168.192.10 52 chars, ret=-1 | |
* |
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 setCacheMaxAge($ageInSecs) | |
{ | |
$this->blq->setContentMaxAge($ageInSecs); | |
$this->blq->setIsUK(true); | |
$this->blq->setShowAdverts(false); | |
$this->blq->setCountry('uk'); | |
$this->blq->setContentCacheability('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
javascript:if(document.createElement && document.childNodes){var bm = document.createElement('script');var head = document.getElementsByTagName('head')[0];head.appendChild(bm);bm.setAttribute('src', 'https://raw.github.com/gist/1217428/grid.js');}else{alert('Sorry, your browser cannot do this')} |