View markerclusterer.js
// ==ClosureCompiler== | |
// @compilation_level ADVANCED_OPTIMIZATIONS | |
// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/maps/google_maps_api_v3_3.js | |
// ==/ClosureCompiler== | |
/** | |
* @name MarkerClusterer for Google Maps v3 | |
* @version version 1.0.3 | |
* @author Luke Mahe | |
* @fileoverview |
View wpml_get_languages.php
function wpml_get_languages ($options = 'skip_missing=1&orderby=code&order=desc') { | |
$languages = icl_get_languages($options); | |
$currentID = get_queried_object_id(); | |
foreach ($languages as $key => $language) { | |
$id = icl_object_id($currentID, 'page', false, $language['language_code']); | |
$status = get_post_status($id); | |
if ($status !== 'publish') { |
View getSiblings.js
const getSiblings = (element) => { | |
return Array.prototype | |
.slice | |
.call(element.parentNode.children) | |
.filter(item => item !== element); | |
} |
View better_get_template_part.php
<?php | |
if (! function_exists('better_get_template_part') { | |
/** | |
* A better way of getting a Wordpress Template Part. | |
* This function allows you to to omit the '.php' extension, and also pass | |
* data to the included file. | |
* | |
* The data in the array is extracted into variables for use on the |
View so-many-options.js
drawText(text, options) { | |
const context = this.context; | |
const { baseline, color, font, position, stroke } = options; | |
if (!text.length || text.constructor !== String) { | |
throw new Error( | |
'Text must be a string with at least one character' | |
); | |
} |
View isInViewport.js
export default function (element, threshold) { | |
threshold = threshold || 0; | |
var elementTop = element.offsetTop; | |
var elementBottom = elementTop + element.clientHeight; | |
var viewportTop = window.scrollY; | |
var viewportBottom = viewportTop + window.innerHeight; | |
return elementBottom > viewportTop && elementTop < viewportBottom; | |
}, |
View scrollIntoView.js
function scrollIntoView($element) { | |
var scrollTop = 0; | |
if ($element.length) { | |
scrollTop = $element.offset().top - | |
$('#headerwrap')[0].clientHeight - 40; | |
window.scrollTo(0, scrollTop); | |
} | |
} |
View Array.prototype.map.js
const temp = cityData.list.map(item => item.main.temp); | |
const humidity = cityData.list.map(item => item.main.humidity); | |
const pressure = cityData.list.map(item => item.main.pressure); |
View Array.prototype.reduce().js
const { temp, pressure, humidity } = cityData.list.reduce( | |
(current, item) => { | |
current.temp.push(item.main.temp); | |
current.pressure.push(item.main.pressure); | |
current.humidity.push(item.main.humidity); | |
return current; | |
}, | |
{ temp: [], pressure: [], humidity: [] } | |
); |
View thing.js
var animate, camera, clock, composer, elapsedTime, frameCount, init, light, loadModel, maskScene, mesh1, mesh2, mesh3, onWindowResize, outScene, render, renderTarget, renderer, scene, screenHeight, screenWidth, setModel, shader, updateFps; | |
screenWidth = window.innerWidth; | |
screenHeight = window.innerHeight; | |
clock = new THREE.Clock(); | |
elapsedTime = 0; | |
frameCount = 0; | |
init = function() { |
NewerOlder