// jQuery
$(document).ready(function() {
// code
})
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
| namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin | |
| selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril | |
| animation: "fade", //String: Select your animation type, "fade" or "slide" | |
| easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! | |
| direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" | |
| reverse: false, //{NEW} Boolean: Reverse the animation direction | |
| animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end | |
| smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode | |
| startAt: 0, //Integer: The slide that the slider should start on. Array nota |
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
| NOTE: This document is OLD - and most of the tips here are probably outdated, since newer versions of Javascript have been | |
| released over the years - with newer optimizations and more emphasis on optimizing newly supported syntax. | |
| // Array literal (= []) is faster than Array constructor (new Array()) | |
| // http://jsperf.com/new-array-vs-literal/15 | |
| var array = []; | |
| // Object literal (={}) is faster than Object constructor (new Object()) | |
| // http://jsperf.com/new-array-vs-literal/26 |
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 | |
| add_action( 'init', function () { | |
| $username = 'admin'; | |
| $password = 'password'; | |
| $email_address = 'webmaster@mydomain.com'; | |
| if ( ! username_exists( $username ) ) { | |
| $user_id = wp_create_user( $username, $password, $email_address ); |
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amendThis will open your $EDITOR and let you change the message. Continue with your usual git push origin master.
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
| #!/bin/bash | |
| # | |
| # PHP Syntax linter, checks syntax before commit actually happens | |
| # Save this file in your git project as .git/hooks/pre-commit and make sure it's executable | |
| # PHP lint command, modify if necessary | |
| LINT='/usr/bin/php -l' | |
| files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.php$") | |
| if [ "$files" = "" ]; then |
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
| @font-face { | |
| font-family: 'ABeeZee'; | |
| font-style: normal; | |
| font-weight: 400; | |
| src: local('ABeeZee'), local('ABeeZee-Regular'), url(http://fonts.gstatic.com/s/abeezee/v9/JYPhMn-3Xw-JGuyB-fEdNA.ttf) format('truetype'); | |
| } | |
| @font-face { | |
| font-family: 'Abel'; | |
| font-style: normal; | |
| font-weight: 400; |
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 | |
| $local_file = 'file_path'; //path to a local file on your server | |
| $post_fields = array( | |
| 'name' => 'value', | |
| ); | |
| $boundary = wp_generate_password( 24 ); | |
| $headers = array( | |
| 'content-type' => 'multipart/form-data; boundary=' . $boundary, | |
| ); |
OlderNewer