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
/** | |
* 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 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
const r = require('rethinkdb'); | |
const { curry } = require('ramda'); | |
module.exports = curry(function* (rdbConn, projectName, collectionName) { | |
const table = yield r.db(`${projectName}_internal`).table('collections').get(collectionName).getField('table').run(rdbConn); | |
return r.db(projectName).table(table); | |
}); |
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
// Usage: from your entrypoint script file or other 'global' module of interest: | |
// require('nodejs-global-module-includes')(module); | |
var Module = require('module'); | |
export default function setModuleIncludePathGlobal(globalModule) { | |
var globalPaths = globalModule.paths; | |
var oldPathHandler = Module._nodeModulePaths; | |
Module._nodeModulePaths = function(from) { |
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
@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 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 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); | |
} |
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 | |
function isNumeric($arr) | |
{ | |
return array_keys($arr) !== range(0, count($arr) - 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
<?php | |
/** | |
* Works around an issue where the multibyte string extension | |
* can be configured to shadow strlen(), and no longer returns pure | |
* bytelength. | |
* @param string $str string to get byte length of | |
* @return int | |
*/ | |
function bytelen($str) | |
{ |
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
ul { | |
list-style:none; | |
padding: 0 0 0 2em; /* padding includes space for character and its margin */ | |
/* IE7 and lower use default */ | |
*list-style: disc; | |
*padding: 0 0 0 1em; | |
} | |
ul li:before { | |
content: '\25BA'; |
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
@BASE_FONT_SIZE = 16; | |
@BASE_LINE_HEIGHT = 1.5; | |
// consistent base font size & line height (16px) | |
html { | |
font-size: 100%; | |
*font-size: 16px; | |
line-height: @BASE_LINE_HEIGHT; | |
} |