$ brew install apcupsd
$ # Kernel extension installation
$ sudo cp -pR /usr/local/Cellar/apcupsd/3.14.13/Library/Extensions/ApcupsdDummy.kext /System/Library/Extensions/
$ sudo chown -R root:wheel /System/Library/Extensions/ApcupsdDummy.kext
$ sudo touch /System/Library/Extensions/
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 <title> tag for better SEO | |
| function seo_title() { | |
| global $post, $page, $paged; | |
| $sep = " | "; # Separator | |
| $newtitle = get_bloginfo('name'); # Default | |
| # Single page ######################################## | |
| if (is_single() || is_page()) { | |
| $newtitle = single_post_title("", false); # default title | |
| } |
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 basic_wp_seo() { | |
| global $page, $paged, $post; | |
| $default_keywords = 'wordpress, plugins, themes, design, dev, development, security, htaccess, apache, php, sql, html, css, jquery, javascript, tutorials'; // customize | |
| $output = ''; | |
| // description | |
| $seo_desc = get_post_meta($post->ID, 'mm_seo_desc', true); | |
| $description = get_bloginfo('description', 'display'); | |
| $pagedata = get_post($post->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
| function replace_open_sans() { | |
| // Kill the original style | |
| wp_deregister_style('open-sans'); | |
| // Replace it with your own (just as an example, I included only the 300 weight) | |
| wp_register_style( 'open-sans', 'http://fonts.googleapis.com/css?family=Open+Sans:300' ); | |
| wp_enqueue_style( 'open-sans'); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'replace_open_sans' ); | |
| // Thanks to @timkinnane | |
| add_action( 'admin_enqueue_scripts', 'replace_open_sans' ); |
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 | |
| //woocommerce中文网关支持paypal | |
| // details at http://devework.com/support-paypal-gateway-in-woocommerce.html | |
| //本函数解决的问题:贝宝不支持你的商铺货币。Gateway Disabled: PayPal does not support your store's currency. | |
| add_filter( 'woocommerce_paypal_supported_currencies', 'enable_custom_currency' ); | |
| function enable_custom_currency($currency_array) { | |
| $currency_array[] = 'CNY'; | |
| return $currency_array; | |
| } |
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 | |
| // Register Custom Post Types | |
| add_action('init', 'register_custom_posts_init'); | |
| function register_custom_posts_init() { | |
| // Register Products | |
| $products_labels = array( | |
| 'name' => 'Products', | |
| 'singular_name' => 'Product', | |
| 'menu_name' => 'Products' |
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
| <button id="load-disqus" onclick="disqus.load();"> | |
| 加载Disqus | |
| </button> | |
| <div id="disqus_thread"></div> |
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
| # MikroTik (RouterOS) script for automatically setting DNS records | |
| # for clients when they obtain a DHCP lease. | |
| # | |
| # author SmartFinn <https://gist.github.com/SmartFinn> | |
| :local dnsTTL "00:15:00"; | |
| :local token "$leaseServerName-$leaseActMAC"; | |
| # Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone") | |
| # - truncate length to 63 chars |
Quick experiments with :before & :after hover effects on single line elements.
A Pen by Misha Heesakkers on CodePen.
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
| # see below for UPDATES that include more shorter ways of conversions | |
| # How to convert GTF format into BED12 format (Human-hg19)? | |
| # How to convert GTF or BED format into BIGBED format? | |
| # Why BIGBED (If GTF or BED file is very large to upload in UCSC, you can use trackHubs. However trackHubs do not accept either of the formats. Therefore you would need bigBed format) | |
| # First, download UCSC scripts | |
| wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/gtfToGenePred | |
| wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/genePredToBed | |
| wget http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/bedToBigBed |
OlderNewer