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
| source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/ | |
| `openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]` | |
| What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file. | |
| Now let’s extract the certificate: | |
| `openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]` |
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_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
| function custom_override_checkout_fields( $fields ) { | |
| unset($fields['billing']['billing_first_name']); | |
| unset($fields['billing']['billing_last_name']); | |
| unset($fields['billing']['billing_company']); | |
| unset($fields['billing']['billing_address_1']); | |
| unset($fields['billing']['billing_address_2']); |
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
| /** | |
| * Add or modify States | |
| */ | |
| add_filter( 'woocommerce_states', 'custom_woocommerce_states' ); | |
| function custom_woocommerce_states( $states ) { | |
| $states['XX'] = array( | |
| 'XX1' => 'State 1', | |
| 'XX2' => 'State 2' |
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 | |
| function cs_prices_only_for_logged_in_users() { | |
| if ( ! is_user_logged_in() && ! is_admin() ) { | |
| remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); | |
| remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); | |
| } | |
| } | |
| add_action( 'init', 'cs_prices_only_for_logged_in_users' ); |
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 | |
| function woocommerce_template_loop_add_to_cart() { | |
| if ( is_user_logged_in() ) | |
| woocommerce_get_template( 'loop/add-to-cart.php' ); | |
| } | |
| function woocommerce_template_single_add_to_cart() { | |
| if ( is_user_logged_in() ) { | |
| global $product; |
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 | |
| /** | |
| * The template for displaying product content within loops. | |
| * | |
| * Override this template by copying it to yourtheme/woocommerce/content-product.php | |
| * | |
| * @author WooThemes | |
| * @package WooCommerce/Templates | |
| * @version 2.4.0 | |
| */ |
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
| \n | |
| ============= HOST: ==========\n | |
| \n | |
| local_ip: %{local_ip}\n | |
| local_port: %{local_port}\n | |
| remote_ip: %{remote_ip}\n | |
| remote_port: %{remote_port}\n | |
| \n | |
| ======= CONNECTION: ==========\n | |
| \n |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
| let regex; | |
| /* matching a specific string */ | |
| regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
| regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
| regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
| /* wildcards */ | |
| regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
| regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <!-- Launch Daemon do not always have access to all the path variables | |
| As a results, scripts will sometimes fail if the you are using path variables inside them | |
| To enable the script to have access to all path variables, open up a terminal and type in --> | |
| <!-- echo $PATH --> | |
| <!-- You can opt to filter out some of the path variables which are not required by script--> | |
| <key>EnvironmentVariables</key> |