This file contains hidden or 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 parseLatLng = (function() | |
{ | |
var matchLocDecimal = /^\s*(-?\d+)(\.\d+)?\s*°?\s*(N|S)?(,|\s)+(-?\d+)(\.\d+)?\s*°?\s*(E|W)?\s*$/; | |
var matchLocDegrees = /^\s*(-?\d+)°?\s*((\d+)(\.\d+)?'?)?\s*(N|S)?(,|\s)+(-?\d+)°?\s*((\d+)(\.\d+)?'?)?\s*(E|W)?\s*$/; | |
var matchLocCompass = /^\s*(-?\d+)°?\s*((\d+)('|\s)+)?\s*((\d+)(\.\d+)?(''|")?)?\s*(N|S)?(,|\s)+(-?\d+)°?\s*((\d+)('|\s)+)?\s*((\d+)(\.\d+)?(''|")?)?\s*(E|W)?\s*$/; | |
return function(val) | |
{ | |
var matches, | |
lat, lng, |
This file contains hidden or 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
window.isPopupBlocked = function(popup_window, cb) | |
{ | |
var CHROME_CHECK_TIME = 2000; // the only way to detect this in Chrome is to wait a bit and see if the window is present | |
function _is_popup_blocked(popup) | |
{ | |
return !popup.innerHeight; | |
} | |
if (popup_window) { |
This file contains hidden or 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
.rotate-ie(@degrees) { | |
-webkit-transform: rotate(@degrees); | |
-o-transform: rotate(@degrees); | |
transform: rotate(@degrees); | |
@cos: cos(@degrees); | |
@sin: sin(@degrees); | |
@nl: `"\n"`; // Newline |
This file contains hidden or 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
/** | |
* Service to manage geoJSON layering with Leaflet.js' angular directive, which only allows 1 set of geoJSON data. | |
* | |
* Assuming you have a leaflet directive with its 'geojson' attribute set to `geojson`, usage is as follows: | |
* var layers = new GeoJSONLayers(); | |
* | |
* layers.addLayer('myLayer', geoJSON, function(feature) { return { fillColor: '#00F' }; }); | |
* $scope.geojson = layers.get(); | |
* | |
* layers.removeLayer('myLayer'); |
This file contains hidden or 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
#!/bin/bash | |
#------------------------------------------------------------------------------# | |
# CONFIGURATION | |
# You will need the following variables set in the git repository to deploy from: | |
# git config --bool receive.denyCurrentBranch false | |
# git config --bool core.bare false | |
# git config --path core.worktree [DEPLOYMENT_DIR] |
This file contains hidden or 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
SET @FROMDOMAIN = 'myolddomain.com'; | |
SET @TODOMAIN = 'mynewdomain.com'; | |
SET @FROMSCHEME = 'http'; | |
SET @TOSCHEME = 'http'; | |
#-------------- STANDARD TABLES -------------# | |
UPDATE wp_options |
This file contains hidden or 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
@BASE_FONT_SIZE : 16px; | |
// translate units by parent element ratio | |
.emsize(@property, @desired, @base : @BASE_FONT_SIZE) { | |
@{property}: 1em * (unit(@desired) / unit(@base)); | |
} | |
// a wrapper for setting font size | |
.emfz(@desired, @base : @BASE_FONT_SIZE) { | |
.emsize(font-size, @desired, @base); |
This file contains hidden or 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 $WPMUPermastructFix; | |
$WPMUPermastructFix = new MultisitePermastructFix(); | |
class MultisitePermastructFix | |
{ | |
public function __construct() | |
{ | |
// start the checking process for main multisite blog. Will strip forced '/blog/' from the start. |
This file contains hidden or 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 initPlaceholderCompat() | |
{ | |
var test = document.createElement('input'), | |
placeholderSupport = 'placeholder' in test; | |
if (placeholderSupport) { | |
return; | |
} | |
$(document).on('focus', '[placeholder]', function() { |
This file contains hidden or 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 | |
function extname($path) | |
{ | |
return substr($path, strrpos($path, '.') + 1); | |
} |