| ⌘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 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
| /*! | |
| * gulp | |
| * $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
| */ | |
| // Load plugins | |
| var gulp = require('gulp'), | |
| sass = require('gulp-ruby-sass'), | |
| autoprefixer = require('gulp-autoprefixer'), | |
| cssnano = require('gulp-cssnano'), |
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
| // Returns an array of dates between the two dates | |
| function getDates (startDate, endDate) { | |
| const dates = [] | |
| let currentDate = startDate | |
| const addDays = function (days) { | |
| const date = new Date(this.valueOf()) | |
| date.setDate(date.getDate() + days) | |
| return date | |
| } | |
| while (currentDate <= endDate) { |
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 | |
| /** | |
| * Convert a multi-dimensional array into a single-dimensional array. | |
| * @author Sean Cannon, LitmusBox.com | [email protected] | |
| * @param array $array The multi-dimensional array. | |
| * @return array | |
| */ | |
| function array_flatten($array) { | |
| if (!is_array($array)) { |
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 lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <meta name="robots" content="noodp, noydir" /> | |
| <link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> | |
| <link rel="canonical" href="http://mysite.com/" /> | |
| <link rel="stylesheet" href="http://mysite.com/style.css" type="text/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
| jQuery(function ($) { | |
| var normalizePostalCode = function (postalCode) { | |
| return postalCode.replace(/[^a-z0-9]/gi, '').toUpperCase(); | |
| }; | |
| var formatPostalCode = function (postalCode) { | |
| var regex = /^([abceghjklmnprstvwxyz][0-9][abceghjklmnprstvwxyz])([0-9][abceghjklmnprstvwxyz][0-9])$/i; | |
| var normalized = normalizePostalCode(postalCode); | |
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 | |
| /** | |
| * Plugin Name: T5 WP Load Order | |
| * Description: Hooks into every action and creates a list of available variables, constants, functions, classes and files. | |
| * Plugin URI: | |
| * Version: 2012.11.05 | |
| * Author: Thomas Scholz | |
| * Author URI: http://toscho.de | |
| * Licence: MIT | |
| * License URI: http://opensource.org/licenses/MIT |
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
| // Validate a Canadian postal code with JQuery Validation | |
| // Use with http://docs.jquery.com/Plugins/Validation | |
| // Adding the method | |
| jQuery.validator.addMethod("cdnPostal", function(postal, element) { | |
| return this.optional(element) || | |
| postal.match(/[a-zA-Z][0-9][a-zA-Z](-| |)[0-9][a-zA-Z][0-9]/); | |
| }, "Please specify a valid postal code."); | |
| // Using the new rule |
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 | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
| * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
| */ | |
| $args = array( |