Creating initial vagrant file
$ vagrant init
Running precise32
$ vagrant init hashicorp/precise32
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ } | |
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ } | |
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ } | |
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } | |
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } | |
@media (min-width:1281px) { /* hi-res laptops and desktops */ } |
<?php | |
/* formats a 10 or 7 digit phone number (number only) by adding dashes at the appropriate locations */ | |
function phoneFormat($number) { | |
if(ctype_digit($number) && strlen($number) == 10) { | |
$number = substr($number, 0, 3) .'-'. substr($number, 3, 3) .'-'. substr($number, 6); | |
} else { | |
if(ctype_digit($number) && strlen($number) == 7) { | |
$number = substr($number, 0, 3) .'-'. substr($number, 3, 4); | |
} |
<?php | |
/** | |
* Add a new <select> field, pre-populated with all countries in our tiny, tiny world. | |
* | |
* @author Maor Chasen | |
*/ | |
function aff_register_ninja_forms_fields() { | |
$args = array( |
# Add these three lines to CORSify your server for everyone. | |
Header set Access-Control-Allow-Origin "*" | |
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE" | |
Header set Access-Control-Allow-Headers "Content-Type, Authorization" |
/* | |
var Trait1 = { | |
method1() {} | |
}; | |
var Trait2 = { | |
method2() {} | |
}; | |
var Trait3 = mixin({ |
Creating initial vagrant file
$ vagrant init
Running precise32
$ vagrant init hashicorp/precise32
#!/usr/bin/env bash | |
# print usage | |
DOMAIN=$1 | |
if [ -z "$1" ]; then | |
echo "USAGE: $0 domain.lan" | |
echo "" | |
echo "This will generate a non-secure self-signed wildcard certificate for given domain." | |
echo "This should only be used in a development environment." |
/*-------------------------------------- | |
Woocommerce - Allow Guest Checkout on Certain products | |
----------------------------------------*/ | |
// Display Guest Checkout Field | |
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
function woo_add_custom_general_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; |
<?php | |
function human_number($number) { | |
$number = preg_replace('/[^\d]+/', '', $number); | |
if (!is_numeric($number)) { | |
return 0; | |
} | |
if ($number < 1000) { |