#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
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', |
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 | |
/** | |
* Replace string with pattern | |
* (example use: for mail templating) | |
* | |
* @codes array(); | |
* @pattern string; | |
*/ | |
$message = 'coba username {username} atau {user_email}'; |
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 | |
/** | |
* _s Theme Options | |
* | |
* @package _s | |
* @since _s 1.0 | |
*/ | |
/** | |
* Register the form setting for our _s_options array. |