This file contains 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 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 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 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 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 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 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
# WP Plugin: Install & Acticate | |
# Usage: wpp plugin-slug | |
alias wpp="wp plugin install $* --activate" | |
# WP Theme: Install | |
# Usage: wpt plugin-slug | |
alias wpt="wp theme install $* --activate" | |
# WP Theme: Activate | |
# Usage: wpta plugin-slug |
This file contains 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 alter_comment_form_fields($fields){ | |
$commenter = wp_get_current_commenter(); | |
$fields['author'] = '<p class="comment-form-input comment-form-author"><label for="author">' . __( 'This is a fancy label', 'your-text-domain' ) . '</label><input id="author" required name="author" type="text" placeholder="Seu nome" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" aria-required="true" /></p>'; | |
return $fields; | |
} |
This file contains 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
#... | |
function gitzip() { | |
git archive -o $@.zip HEAD | |
} | |
#... gitzip ZIPPED_FILE_NAME |
This file contains 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 | |
/** | |
* Case-insensitive in_array() wrapper. | |
* | |
* @param mixed $needle Value to seek. | |
* @param array $haystack Array to seek in. | |
* @param bool $strict If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack. | |
* | |
* @return bool |