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
| split -d -b 4300m backup.tar.bz2 backup.tar.bz2. | |
| cat backup.tar.bz2.* > backup.tar.bz2 |
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
| sed 's/old/new/g' input.txt > output.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
| $myValue = '123'; | |
| // First you need to set the visual value, then you need to set it selected, this is retarted | |
| $('#myselect').val($myValue).attr("selected", "selected"); |
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
| tar -c --bzip2 -f foo.tar.bz1 foo/ |
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 get_attachment_id_from_src ($src) { | |
| global $wpdb; | |
| $reg = "/-[0-9]+x[0-9]+?.(jpg|jpeg|png|gif)$/i"; | |
| $src1 = preg_replace($reg,'',$src); | |
| if($src1 != $src){ | |
| $ext = pathinfo($src, PATHINFO_EXTENSION); | |
| $src = $src1 . '.' .$ext; | |
| } | |
| $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$src'"; | |
| $id = $wpdb->get_var($query); |
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( 'add_meta_boxes', 'custom_meta_boxes' ); | |
| add_action( 'save_post', 'ExtraImageProperty_save' ); | |
| function custom_meta_boxes() { | |
| add_meta_box('ExtraImageProperty', 'Extra Image Property', 'ExtraImageProperty', 'page'); | |
| } | |
| function ExtraImageProperty() { | |
| global $post; | |
| $extra_image_url = get_post_meta($post->ID, 'extra_image_url', true); |
NewerOlder