// 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
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
| UPDATE: | |
| I used 'sudo tasksel install lamp-server' instead of 'sudo tasksel' (then selecting) to stop the SSH problems I've been having with ubuntu 12.04 | |
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
| Create a amazon aws account (http://aws.amazon.com) and enter the AWS management dashboard (https://console.aws.amazon.com/ec2/home). Select the EC2 tab at the top of the dashboard. | |
| 1) Create a Security Group that allows HTTP connections and limited SSH to configure the instance. Click on Security Groups > Create Security Group | |
| - Name: web_access |
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
Show hidden characters
| [ | |
| // Basic drag select | |
| { | |
| "button": "button1", "count": 1, | |
| "press_command": "drag_select_callback" | |
| }, | |
| { | |
| // Select between selection and click location | |
| "button": "button1", "modifiers": ["shift"], | |
| "press_command": "drag_select_callback", |
###Init
- Spawn Ubuntu instance.
- Update aptitude with
sudo apt-get update - Install junk we want
sudo apt-get install nginx spawn-fcgi php5 php5-cli php5-common php5-suhosin php5-cgi php-pear php5-mysql htop git - Set root password
sudo passwd root
###Setup PHP
- Change /etc/nginx/sites-available/default to:
server {
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 | |
| /** | |
| ** A base module for [text], [text*], [email], and [email*] | |
| **/ | |
| /* Shortcode handler */ | |
| wpcf7_add_shortcode( 'text', 'wpcf7_text_shortcode_handler', true ); | |
| wpcf7_add_shortcode( 'text*', 'wpcf7_text_shortcode_handler', true ); | |
| wpcf7_add_shortcode( 'email', 'wpcf7_text_shortcode_handler', true ); |
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
| /* | |
| * | |
| * Função para verificar se existe usuário logado em loja Vtex | |
| * | |
| * Uso: | |
| * if(is_logged()) { | |
| * // código se está logado | |
| * } else { | |
| * // código se NÃO está logado | |
| * } |
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 | |
| # Functions ============================================== | |
| # return 1 if global command line program installed, else 0 | |
| # example | |
| # echo "node: $(program_is_installed node)" | |
| function program_is_installed { | |
| # set to 1 initially | |
| local return_=1 |
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( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
| /** | |
| * Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE. | |
| * IE10 and up does not support conditional comments in standards mode. | |
| * | |
| * @uses wp_style_add_data() WordPress function to add the conditional data. | |
| * @link https://developer.wordpress.org/reference/functions/wp_style_add_data/ |
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_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 ); | |
| function woocommerce_category_image() { | |
| if ( is_product_category() ){ | |
| global $wp_query; | |
| $cat = $wp_query->get_queried_object(); | |
| $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
| $image = wp_get_attachment_url( $thumbnail_id ); | |
| if ( $image ) { | |
| echo '<img src="' . $image . '" alt="' . $cat->name . '" />'; | |
| } |
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 | |
| $file = 'TrunkMonkey_Rescue.mov'; | |
| $result = shell_exec('ffmpeg -i ' . escapeshellcmd($file) . ' 2>&1'); | |
| preg_match('/(?<=Duration: )(\d{2}:\d{2}:\d{2})\.\d{2}/', $result, $match); | |
| print_r($match); |