⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
/* Since script loading is dynamic, we take | |
a callback function with our loadScript call | |
that executes once the script is done downloading/parsing | |
on the page. | |
*/ | |
var loadScript = function(src, callbackfn) { | |
var newScript = document.createElement("script"); | |
newScript.type = "text/javascript"; | |
newScript.setAttribute("async", "true"); | |
newScript.setAttribute("src", src); |
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
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
var metas = document.getElementsByTagName('meta'); | |
var i; | |
if (navigator.userAgent.match(/iPhone/i)) { | |
for (i=0; i<metas.length; i++) { | |
if (metas[i].name == "viewport") { | |
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
} | |
} |
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 Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu { | |
function start_lvl( &$output, $depth ) { | |
//In a child UL, add the 'dropdown-menu' class | |
$indent = str_repeat( "\t", $depth ); | |
$output .= "\n$indent<ul class=\"dropdown-menu\">\n"; |
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 | |
// Append the Gravity Forms ID to the end of the filter so that the validation only runs on this form | |
add_filter('gform_validation_1', 'custom_validation'); | |
function custom_validation($validation_result){ | |
$form = $validation_result["form"]; | |
foreach($form['fields'] as &$field){ | |
/* Check that the value of the field that was submitted. e.g. the name="input_1" that is generated by Gravity Forms */ | |
if($_POST['input_1'] == "Your First Name"){ | |
// set the form validation to false | |
$validation_result["is_valid"] = 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
/** | |
* Create HTML list of nav menu items and allow HTML tags. | |
* Replacement for the native menu Walker, echoing the description. | |
* This is the ONLY known way to display the Description field. | |
* | |
* @see http://wordpress.stackexchange.com/questions/51609/ | |
* | |
*/ | |
class Description_Walker extends Walker_Nav_Menu { |
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 soliloquy_slider_header_home() { | |
if (is_home()&& function_exists( 'soliloquy_slider' ) ) { | |
soliloquy_slider( '88' ); | |
} | |
} | |
add_action('genesis_header', 'soliloquy_slider_header_home'); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wpsites.net/best-plugins/add-soliloquy-slider-in-header-of-any-theme/ | |
*/ |
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
cd ~/wordpress/my_wordpress_app | |
git init . | |
git add . --all | |
git commit -m "initial commit" |
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
git push -f production master |