#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
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 | |
| /** | |
| * Repeatable Custom Fields in a Metabox | |
| * Author: Helen Hou-Sandi | |
| * | |
| * From a bespoke system, so currently not modular - will fix soon | |
| * Note that this particular metadata is saved as one multidimensional array (serialized) | |
| */ | |
| function hhs_get_sample_options() { |
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
| SELECT p.ID, p.post_type, p.post_status, m.* FROM wp_posts p LEFT JOIN | |
| ( SELECT | |
| post_id, | |
| GROUP_CONCAT(if(meta_key = 'campaign_description', meta_value, NULL)) AS 'description', | |
| GROUP_CONCAT(if(meta_key = 'campaign_start', meta_value, NULL)) AS 'start', | |
| GROUP_CONCAT(if(meta_key = 'campaign_end', meta_value, NULL)) AS 'end', | |
| GROUP_CONCAT(if(meta_key = 'campaign_priority', meta_value, NULL)) AS 'priority' | |
| FROM wp_postmeta | |
| GROUP BY post_id ) m | |
| ON m.post_id = p.ID |
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
| /* | |
| Replace default osx keymap, or just add this to Preferences -> Key Bindings -> User | |
| */ | |
| [ | |
| { "keys": ["ctrl+q"], "command": "exit" }, | |
| { "keys": ["ctrl+shift+n"], "command": "new_window" }, | |
| { "keys": ["ctrl+shift+w"], "command": "close_window" }, | |
| { "keys": ["ctrl+o"], "command": "prompt_open_file" }, | |
| { "keys": ["ctrl+shift+t"], "command": "reopen_last_file" }, |
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 | |
| /** | |
| * login_with_email filter to the authenticate filter hook, to fetch a username based on entered email | |
| * @param obj $user | |
| * @param string $username [description] | |
| * @param string $password [description] | |
| * @return boolean | |
| */ | |
| add_filter('authenticate', 'login_with_email', 20, 3); |
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
| function _getPostByCategory($post_type, $category_slug){ | |
| global $wpdb; | |
| $query = "SELECT p.*, terms.term_taxonomy_id, terms.term_id, terms.slug, terms.name from $wpdb->posts p INNER JOIN | |
| ( SELECT rel.object_id , rel.term_taxonomy_id, term.term_id, term.name, term.slug FROM $wpdb->term_relationships rel | |
| INNER JOIN (SELECT ttax.term_taxonomy_id, ttax.term_id, t.name, t.slug FROM $wpdb->term_taxonomy ttax | |
| INNER JOIN $wpdb->terms t ON t.term_id = ttax.term_id | |
| ) term | |
| ON rel.term_taxonomy_id = term.term_taxonomy_id ) terms | |
| ON p.ID = terms.object_id |
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
| ## Run on server | |
| alias git-receive-pack="/usr/local/cpanel/3rdparty/bin/git-receive-pack" | |
| ## I still need to add it to my ~/.bashrc | |
| export PATH=$PATH:"/usr/local/cpanel/3rdparty/bin" | |
| ## Also, on a side note the whole stdin: is not a TTY error can be fixed by removing the /home/git/.bashrc file. |
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
| #rewrite all subdomain on old domain to subdomain on new domain | |
| RewriteCond %{HTTP_HOST} ^(.*)\.olddomain\.com$ [NC] | |
| RewriteRule ^(.*)$ http://%1.newdomain.com/$1 [R=301,L] | |
| # rewrite all links to new domain | |
| RewriteEngine on | |
| RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L] | |
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 | |
| ### change the values below where needed..... | |
| ### taken from http://moinne.com/blog/ronald/mysql/backup-large-databases-with-mysqldump | |
| DBNAMES="MyDb1 MyDb2 MyDb3" | |
| HOST="--host=localhost" | |
| USER="--user=root" | |
| PASSWORD="--password=MyPassword" | |
| BACKUP_DIR="/MyBackupDirectory" | |
| #### you can change these values but they are optional.... |
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 custom_bp_nav() { | |
| global $bp; | |
| bp_core_new_nav_item( | |
| array( | |
| 'name' => __( 'Site Settings', 'buddypress' ), | |
| 'slug' => 'site-settings', | |
| 'position' => 80, | |
| 'screen_function' => 'site_settings_screen', |