Skip to content

Instantly share code, notes, and snippets.

var xyzZoomLevel = new OpenLayers.Layer.XYZ("xyzZoomLevel",
["http://mapserver.local/${z}/${x}/${y}.png"], {
sphericalMercator: true,
transitionEffect: "resize",
wrapDateLine: true,
minResolution: 2445.9849, //The lowest resolution on the map
maxResolution: 611.4962, //The max resolution on the map
resolutions: [2445.9849, 1222.9925, 611.4962], //The list of resolution on the map.
numZoomLevel: 3,//The number of zoom on the map, (= resolution length)
//The resolution start from 2445.9849 socorrespondig
@Pop-Code
Pop-Code / .bash_profile
Last active December 18, 2015 09:29
Get the Mapnik stylesheets
export MAPNIK_INSTALL=/Library/Frameworks/Mapnik.framework/unix
export PROJ_LIB=${MAPNIK_INSTALL}/share/proj
export ICU_DATA=${MAPNIK_INSTALL}/share/icu
export GDAL_DATA=${MAPNIK_INSTALL}/share/gdal
sudo osm2pgsql [osmfile] -U postgres -d [osmdatabase] -W -S /usr/local/share/osm2pgsql/default.style
@Pop-Code
Pop-Code / add-postgis-functions.sh
Created December 4, 2012 15:20
Install PostGresql PostGis and osm2pgsql
psql -d yourdatabase -f Chemin_vers_le_dossier_contrib/postgis.sql -U postgres
psql -d yourdatabase -f Chemin_vers_le_dossier_contrib/postgis_comments.sql -U postgres
psql -d yourdatabase -f Chemin_vers_le_dossier_contrib/spatial_ref_sys.sql -U postgres
@Pop-Code
Pop-Code / comments.php
Created September 29, 2012 17:33
Facebook AWD comments template
<?php
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die (esc_html__('Please do not load this page directly. Thanks!','Polished'));
if ( post_password_required() ) { ?>
<p class="nocomments"><?php esc_html_e('This post is password protected. Enter the password to view comments.','Polished') ?></p>
<?php
return;
@Pop-Code
Pop-Code / action.php
Created September 27, 2012 23:49
Facebook AWD opengraph Actions shortcodes
<?php
echo do_shortcode('[AWD_facebook_opengraph_actions option="value" otheroption="othervalue"]Content Here[/AWD_facebook_opengraph_actions]');
?>
@Pop-Code
Pop-Code / gist:3797062
Last active October 11, 2015 03:38
Get Facebook user data from WP_User ID
<?php
$user_id = 1; //the ID of your choice
$user_data_me = get_user_meta($user_id, 'fb_user_infos', true);
$user_data_mail = get_user_meta($user_id, 'fb_email', true);
$user_data_fb_uid = get_user_meta($user_id, 'fb_uid', true);
?>
@Pop-Code
Pop-Code / gist:3797044
Created September 27, 2012 23:20
Get Current Facebook User data
global $AWD_facebook;
//check if a user is connected with facebook
if($AWD_facebook->is_user_logged_in_facebook()){
//get the data of the current user.
$fb_me = $AWD_facebook->me;
//Debug the user Data.
var_dump($fb_me);
}
@Pop-Code
Pop-Code / functions.php
Last active October 11, 2015 03:37
Get Facebook API in Facebook AWD
<?php
/**
* Helper to access Facebook AWD api object
* Return a AWD_facebook_api object that extends the Facebook API.
*/
function getFacebookApi(){
global $AWD_facebook;
if(is_object($AWD_facebook->fcbk)){
return $AWD_facebook->fcbk;
}
@Pop-Code
Pop-Code / likebutton.php
Created September 27, 2012 22:28
Facebook AWD like Button shortcodes
<?php
echo do_shortcode('[AWD_likebutton option="value" otheroption="othervalue"]');
?>