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
https://github.com/Yoast/wordpress-seo/issues/6121 | |
// if ( is_multisite() && ms_is_switched() ) { | |
// return false; | |
// } |
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
open up a new cmd as administrator and run this command: | |
npm install --global --production windows-build-tools | |
then | |
npm config set msvs_version 2015 --global | |
close all instances of shell/cmd, reopen a cmd (regular this time, non-administrator) return to your directory where you are trying to run npm install and run it again | |
source: https://github.com/chjj/pty.js/issues/60 | |
credit: mokanfar |
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
// Move an element withing the DOM at 992 window width - additional CSS required | |
var moveHtmlElement = function(init_el, add_cl, rm_cl, target_el, return_el) { | |
if ($(window).width() < 992) { | |
$(init_el).addClass(add_cl); | |
$(init_el).removeClass(rm_cl); | |
$(init_el).insertAfter(target_el); | |
} else { | |
$(init_el).addClass(rm_cl); | |
$(init_el).removeClass(add_cl); | |
$(init_el).insertAfter(return_el); |
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
// Web fonts | |
@mixin font-face($family, $file) { | |
@font-face { | |
font-family: $family; | |
src: url('#{$path-font}/#{$file}-webfont.eot'); | |
src: url('#{$path-font}/#{$file}-webfont.eot?#iefix') format('embedded-opentype'), | |
url('#{$path-font}/#{$file}-webfont.woff') format('woff'), | |
url('#{$path-font}/#{$file}-webfont.ttf') format('truetype'); | |
} |
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
//element vars | |
var taskInput = document.getElementById("new-task"); //new-task | |
var addButton = document.getElementsByTagName("button")[0]; //first button | |
var incompleteTasksHolder = document.getElementById("incomplete-tasks"); //incomplete-tasks | |
var completedTasksHolder= document.getElementById("completed-tasks"); //completed-tasks | |
var createNewTaskElement = function(taskString) { | |
var listItem = document.createElement("li"); | |
var checkBox = document.createElement("input"); | |
var label = document.createElement("label"); |
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
public function getCategory($category) { | |
$customers = Customer::whereHas('categories', function($query) use | |
($category) { | |
$query->where('name', '=', $category); | |
})->get(); | |
return view('customers.index', compact('customers')); | |
} | |
//http://laravel.io/forum/02-25-2014-eager-loading-with-constrains-load-post-based-on-category-name |
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
http://stackoverflow.com/questions/6865194/fluid-width-with-equally-spaced-divs | |
Using the 'stretch CSS method' see link above.. |
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 | |
/*=================================== | |
ENCAPSULATION - protecting our code | |
===================================*/ | |
//this shows the benefits of encapsulation; ie protecting certain methods and parts of your code from external modification | |
class Person { | |
//by declaring our properties private all subsequent methods may only be called from within the class on instantiation. | |
private $name; | |
private $age; |
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 | |
class Task { | |
public $title; | |
public $description; | |
public function __construct($title, $description) { | |
$this->title = $title; | |
$this->description = $description; | |
} |