http://twitter.com/share?text=<TITLE>&url=<URL>
E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com
http://www.facebook.com/sharer.php?u=&p[title]=
| #!/usr/bin/swift | |
| // DISCLAIMER | |
| // This script modifies an unencrypted file associated with the trial version of Final Cut Pro. | |
| // Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological | |
| // protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections. | |
| // Distributing this code is therefore legal under the DMCA. | |
| // This script is intended for educational and research purposes, such as exploring trial-related file structures, |
| /** | |
| * Force all network uploads to reside in "wp-content/uploads", and by-pass | |
| * "files" URL rewrite for site-specific directories. | |
| * | |
| * @link http://wordpress.stackexchange.com/q/147750/1685 | |
| * | |
| * @param array $dirs | |
| * @return array | |
| */ | |
| function wpse_147750_upload_dir( $dirs ) { |
| /** | |
| * Detects if two elements are colliding | |
| * | |
| * Credit goes to BC on Stack Overflow, cleaned up a little bit | |
| * | |
| * @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery | |
| * @param $div1 | |
| * @param $div2 | |
| * @returns {boolean} | |
| */ |
| <?php | |
| $url = 'http://server.com/path'; | |
| $data = array('key1' => 'value1', 'key2' => 'value2'); | |
| // use key 'http' even if you send the request to https://... | |
| $options = array( | |
| 'http' => array( | |
| 'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
| 'method' => 'POST', | |
| 'content' => http_build_query($data), |
| /** | |
| * You often need to get the content or title from a specific post. | |
| * Sometimes, using a custom loop is the better option, but when you only need | |
| * to get information from a specific post, there’s a better option | |
| */ | |
| echo get_post_field('post_content', $post_id); |
| /** | |
| * Custom WP gallery | |
| */ | |
| add_shortcode('gallery', 'my_gallery_shortcode'); | |
| function my_gallery_shortcode($attr) { | |
| $post = get_post(); | |
| static $instance = 0; | |
| $instance++; |
| <?php | |
| require("postmark.php"); | |
| $postmark = new Postmark("your-api-key","from-email","optional-reply-to-address"); | |
| if($postmark->to("[email protected]")->subject("Email Subject")->html_message("<p style='color: red'>Test mail</p>")->send()){ | |
| echo "Message sent"; | |
| } |
| <?php | |
| /** | |
| * Add All Custom Post Types to search | |
| * | |
| * Returns the main $query. | |
| * | |
| * @access public | |
| * @since 1.0 | |
| * @return $query |
| function getScrollBarWidth() { | |
| var inner = document.createElement('p'); | |
| inner.style.width = "100%"; | |
| inner.style.height = "200px"; | |
| var outer = document.createElement('div'); | |
| outer.style.position = "absolute"; | |
| outer.style.top = "0px"; | |
| outer.style.left = "0px"; | |
| outer.style.visibility = "hidden"; |