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
protected function removeOutliers($terms) | |
{ | |
$dataToCheck = ['searchVolume']; | |
$sorted = $this->sortTerms($terms, 'searchVolume'); | |
foreach($dataToCheck as $dataTerm) { | |
$house = []; | |
$mean = 0; | |
foreach($sorted as $data) { | |
array_push($house, $data[$dataTerm]); | |
$mean += $data[$dataTerm]; |
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
'use strict'; | |
// Besure gulp-composer is installed | |
// npm install --save gulp-composer | |
var gulp = require('gulp'); | |
var composer = require('gulp-composer'); | |
gulp.task('default', ['composer']); |
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
filters: { | |
'explodingCamels': function(string) { | |
var toReturn = ''; | |
for (var i = 0; i < string.length; i++) { | |
var character = string.charAt(i); | |
if (isNaN(character * 1)) { | |
if (i != 0 && character == character.toUpperCase()) { | |
toReturn += ' '; | |
} | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<!-- jQuery import --> | |
<script src="https://code.jquery.com/jquery-latest.js"></script> | |
<!-- Latest compiled and minified JavaScript --> | |
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> --> | |
<!-- Latest compiled and minified CSS | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> |
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
array_map(function($val) { | |
if (array_search($val, $this->cities) === false) { | |
$this->cities[] = $val; | |
} | |
}, array_merge($popConcert, $popSports)); |
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
public function register_taxonomies() | |
{ | |
$tags = [ | |
'performer' => [ | |
'name' => _x( 'Performers', 'taxonomy general name' ), | |
'singular_name' => _x( 'Performer', 'taxonomy singular name' ), | |
'search_items' => __( 'Search Performers' ), | |
'all_items' => __( 'All Performers' ), | |
'parent_item' => null, |
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
$cats = [ | |
'parent', | |
'children', | |
'grandchildren' | |
]; | |
$args = []; | |
for ($i = 0; $i < count($cats); $i++) { |
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 | |
private function formatJsObjectToJson($jsObjectString) | |
{ | |
return implode(',', array_map( function($y) { if (!$y) { return '""'; } return $y; }, explode(',', preg_replace_callback('/({|,)(\w*):+/', function($e) { return $e[1] . '"' . $e[2] . '":'; }, $jsObjectString)))); | |
} |
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
module.exports = { | |
filters: { | |
'format_kebab_case' : function(str) { | |
var x = str.split('_'); | |
x.forEach(function(el, i) { | |
x[i] = this.replaceAt(el, 0, el.charAt(0).toUpperCase()) | |
}, this); | |
return x.join(' '); |
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
random |
OlderNewer