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
/** | |
* Dynamic template from an arbitrary string | |
* (which could be stored in an external file or even in a database). | |
* | |
* Works even without the "plus" extension of the Templates plugin. | |
* http://github.com/nje/jquery-tmpl | |
*/ | |
var MyData = {hello: "world"}; | |
$.template("MyInlineTemplate", "<div>Hello ${hello}</div>"); | |
$.tmpl("MyInlineTemplate", MyData).appendTo("#contents"); |
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
/** | |
* VEMap.CreatePushpin(point, options) and similar functions | |
* to create advanced pins, polylines & polygons easily in Bing Maps. | |
*/ | |
function _addshapeoptions(scope_, type_, points_, options_){ | |
var shape = new VEShape(type_, points_); | |
options_ = options_ || false; | |
if (options_){ | |
for (var key in options_){ |
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
/** | |
* This snipplet adds the following methods: | |
* VEMap.DropPushpin | |
* VEShapeLayer.DropPushpin | |
* | |
* This is similar to VEMap.AddPushpin except the pin is animated (it "falls" on the map). | |
* | |
* Works even in IE6 and the IPhone. Generic solution based on this proof of concept: | |
* http://www.garzilla.net/vemaps/DropPushPin.aspx | |
*/ |
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
/** | |
* Adds pan and zoom support for touch-based devices. | |
* Works best with fixed-size viewports, however VEMap.ZoomIn & VEMap.ZoomOut | |
* are very unreliable on the IPhone, you should keep the mini dashboard as a fallback. | |
*/ | |
VEMap.prototype.EnableTouch = function(){ | |
if (typeof Touch == "object"){ | |
var map = this; | |
// Whether a gesture is being performed currently or not. |
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
#VRML V2.0 utf8 | |
Transform { | |
translation -4 2 0 | |
children Shape { | |
appearance Appearance{ | |
material Material{ | |
diffuseColor 0 0 0 | |
emissiveColor 1 1 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
-- If `polygons` is a column that contains MULTIPOLYGON values, | |
-- this returns one row per polygon. | |
SELECT | |
id AS id, | |
ST_Box2D((ST_Dump(polygons)).geom) AS bbox | |
FROM | |
mytable | |
WHERE | |
polygons IS NOT NULL |
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 | |
global $user; | |
$tmp = NULL; | |
session_destroy(); | |
user_module_invoke('logout', $tmp, $user); | |
$user = drupal_anonymous_user(); | |
?> |
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 | |
/** | |
* In this example, it uses the administration theme on "node creation", "node edition", | |
* "user registration", "user profile" and "forgot password" pages. | |
*/ | |
function MODULENAME_init(){ | |
// The list of paths on which to use the administration theme |
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
/********************************************************************************************* | |
* Pin 1: Standard non-sticky autogenerated infobox. | |
*********************************************************************************************/ | |
var pin1 = map.AddPushpin( | |
new Microsoft.Maps.Location(50, 0), | |
{ | |
text: '1', | |
// Standard infobox settings | |
title: 'Standard (non-sticky) infobox', |
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
/** | |
* By default, the new dashboard (the white components bar on top of the map) is only 350 pixels wide, | |
* but you can easily make it use the whole space available with CSS. | |
* | |
* "mapContainer" is the id of the div that contains the Map. | |
* If you are using only one map on the map, you can use ".MicrosoftMap .NavBar" directly | |
*/ | |
#mapContainer .MicrosoftMap .NavBar { | |
width: 100%; |