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
"\e[1~": beginning-of-line # Home key | |
"\e[4~": end-of-line # End key | |
"\e[3~": delete-char # Delete key | |
"\e[5C": forward-word # Ctrl+right | |
"\e[5D": backward-word # Ctrl+left | |
"\e\e[C": forward-word # Alt+right | |
"\e\e[D": backward-word # Alt+left | |
"\C-K": unix-line-discard # Ctrl+K | |
"\e\"": "@{}\e[D" # Insert @{} move cursor into braces |
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
$ git config --global core.excludesfile ~/.gitignore | |
$ echo .DS_Store >> ~/.gitignore |
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
global $wpdb; | |
$query = "SELECT meta_value, meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata'"; | |
$result = $wpdb->get_results($query); | |
foreach ($result as $item) { | |
$meta = unserialize($item->meta_value); | |
unset($meta['sizes']); | |
$wpdb->update( 'wp_vira_postmeta', array('meta_value' => serialize($meta)), array('meta_id' => $item->meta_id) ); | |
} |
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
global $wpdb; | |
$query = "UPDATE $wpdb->posts SET post_content = REPLACE ( | |
post_content, | |
'http://old.com', | |
'http://new.com')"; | |
$wpdb->query($query); | |
$query = "UPDATE $wpdb->posts SET guid = REPLACE ( |
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 isScrolledIntoView(elem) { | |
var $win = $(window), | |
$elem = $(elem), | |
docViewTop = $win.scrollTop(), | |
docViewBottom = docViewTop + $win.height(), | |
elemTop = $elem.offset().top, | |
elemBottom = elemTop + $elem.height(); | |
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) && (elemBottom <= docViewBottom) && (elemTop >= docViewTop)); | |
} |
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
// Rounds all the corners of a box | |
@mixin vector-bg-with-fallback($name) { | |
background-image: image-url('#{$name}.png'); | |
background-image: none, image-url('#{$name}.svg'); | |
} | |
@mixin border-radius($radius, $clip: padding-box) | |
-webkit-border-radius: $radius | |
-moz-border-radius: $radius | |
-o-border-radius: $radius |
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
$resources['ur_segment'] = array( | |
'operations' => array( | |
'create' => array( | |
'callback' => '_ur_segment_create', | |
'help' => t('Creates a segment.'), | |
'args' => array( | |
array( | |
'name' => 'segment', | |
'optional' => FALSE, | |
'source' => 'data', |
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 | |
# | |
# ======================= | |
# Linode vhost script | |
# ======================= | |
function make_vhost | |
{ | |
cat <<- _EOF_ | |
<VirtualHost *:80> |
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
$ mate /etc/php.ini | |
Add: error_log = /Users/USERNAME/Library/Logs/php.log | |
$ sudo chmod 755 ~/Library/ && sudo chmod 755 ~/Library/Logs && sudo touch ~/Library/Logs/php.log && sudo chmod 777 ~/Library/Logs/php.log |
OlderNewer