cd
into your Dev folder- git clone scotchbox folderName
- change ** in vagrantfile line
config.vm.network "private_network", ip: "192.168.33.**"
to a new two digit number - open up hosts file (Finder -> Go -> Go To Folder - > /private/etc/hosts )
- if you don't have access to edit that, create new plaintext doc
- add new line with
192.168.33.** urlName.dev
with ** being the two digit number you entered - if you used a new plaintext doc, override/replace /private/etc/hosts with new file
- prints off the array and its keys
- helpful when you get the error trying to do $myarray[0] since there's some weird stuff with keys in php
- need to figure out php keys
- more info here
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
jQuery(window).scroll(function(){ | |
var previousHeight = jQuery('#animation-trigger').prev().height() ; | |
var startingPixelsDown = jQuery('#animation-trigger').offset().top; | |
var currentViewPortPosition = jQuery(window).scrollTop(); | |
//console.log(startingPixelsDown); | |
// console.log( currentViewPortPosition + previousHeight); | |
// console.log(startingPixelsDown - ( currentViewPortPosition + previousHeight ) ); | |
// console.log(startingPixelsDown); | |
var pixelsToGoTillDivAtTop = startingPixelsDown - ( currentViewPortPosition + previousHeight ) ; |
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
<div class="flex-container"> | |
<p>This is some text we want to right align</p> | |
</div> | |
<style> | |
.flex-container { | |
text-align: right; | |
display: flex; | |
} | |
// OR! |
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
// We create an object of the specific divs we want to sort | |
var games = jQuery('.future-games-box .single-game-listing-box'); | |
// then we create a function to | |
var orderedDivs = jQuery(games).sort(function(a,b){ | |
// We are targeting the text, which is a date, inside of the | |
// <p></p> that is inside of the div .single-listing-box | |
return jQuery(a).find("p").html() > jQuery(b).find("p").html(); | |
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
add_action('wp_ajax_testFunction', 'testFunction'); | |
add_action('wp_ajax_nopriv_testFunction', 'testFunction'); | |
function testFunction() { | |
?> | |
<p>I WAS CALLED!</p> | |
<?php | |
$p= $_GET['id']; | |
?> | |
<p>And I got <?php echo $p; ?> for id</p> |
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
<div class="text-box"> | |
<?php | |
$textGroup = $page['text_group']; | |
// prettyEcho($text); | |
foreach($textGroup as $text){ | |
if($text['heading']){ ?> |
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 | |
// http://php.net/manual/en/functions.anonymous.php | |
$anon = function($var){ | |
return $var + 1; | |
}; | |
$arrayCheck = array( | |
'function' => $anon, |
OlderNewer