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
| @DATABASE@__%Y-%m-%d_%H-%M-%S |
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
| <style> | |
| ul { | |
| list-style:none; | |
| } | |
| li { | |
| display: inline-block; | |
| padding: 5px; | |
| } | |
| </style> |
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 if( !defined( 'ABSPATH' ) ) { die(); } // Include in all php files, to prevent direct execution | |
| /** | |
| * Class Name : WP Persistent Notices | |
| * Description : Implements a Standardized messaging system that allows admin messages to be passed across page redirects. | |
| * Class URI : http://gschoppe.com/wordpress/pass-wordpress-admin-notices-across-page-redirects/ | |
| * Version : 1.0.0 | |
| * Author : Greg Schoppe | |
| * Author URI : http://gschoppe.com | |
| * License: GPL-2.0+ | |
| * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
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 | |
| avail=/etc/httpd/sites-enabled/$1.conf | |
| enabled=/etc/httpd/sites-enabled | |
| site=`ls /etc/httpd/sites-enabled/` | |
| if [ "$#" != "1" ]; then | |
| echo "Use script: a2dissite virtual_site" | |
| echo -e "\nAvailable virtual hosts: \n$site" | |
| exit 0 | |
| else |
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
| using System.Data.Entity; | |
| using System.Data.Entity.ModelConfiguration.Conventions; | |
| namespace Test.Models { | |
| public DbSet<Friendship> Friendships { get; set; } | |
| protected override void OnModelCreating(DbModelBuilder modelBuilder) { | |
| /* USER */ | |
| modelBuilder.Entity<User>().HasMany(u => u.Friends).WithMany(); |
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 /opt/wp-completion.bash | |
| export DEV=/var/www/html | |
| export EDITOR=subl | |
| export PS1="\[$(tput bold)\]\[\033[38;5;58m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;58m\]\H\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\] [\t] \w \\$\n> \[$(tput sgr0)\]" | |
| # function to set terminal title | |
| function set-title() { | |
| if [[ -z "$ORIG" ]]; then | |
| ORIG=$PS1 |
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
| javascript: (function() { | |
| var htmlStyle = document.documentElement.style; | |
| var adminBarStyle = document.getElementById('wpadminbar').style; | |
| if(undefined == window.hasAdminBar){ | |
| window.hasAdminBar = true; | |
| } | |
| var cssText, display; |
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_no_products_found', 'show_products_on_no_products_found', 20 ); | |
| function show_products_on_no_products_found() { | |
| echo '<h2>' . __( 'Mas você pode gostar disso...', 'domain' ) . '</h2>'; | |
| echo do_shortcode( '[recent_products per_page="4"]' ); | |
| } |
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
| // SublimeLinter Settings - User | |
| { | |
| "paths": | |
| { | |
| "linux": ["~/.config/composer/vendor/bin"] | |
| } | |
| } |
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" |