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 | |
| error_reporting(E_ALL); | |
| $opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']); | |
| if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) { | |
| $self = basename(__FILE__); | |
| echo <<<EOF | |
| Usage: | |
| php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<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
| /* | |
| * Add our Custom Fields to simple products | |
| */ | |
| function mytheme_woo_add_custom_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; | |
| // Text Field |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #ifdef _MSC_VER | |
| #include <intrin.h> /* for rdtscp and clflush */ | |
| #pragma optimize("gt",on) | |
| #else | |
| #include <x86intrin.h> /* for rdtscp and clflush */ | |
| #endif |
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 custom_pre_get_posts_query( $q ) { | |
| $tax_query = (array) $q->get( 'tax_query' ); | |
| $tax_query[] = array( | |
| 'taxonomy' => 'product_cat', | |
| 'field' => 'slug', | |
| 'terms' => array( 'clothing' ), // Don't display products in the clothing category on the shop page. | |
| 'operator' => 'NOT IN' | |
| ); |
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
| // Requires node.js and mqtt library installed. | |
| var mqtt = require('mqtt'); | |
| var os = require("os"); | |
| const thingsboardHost = "demo.thingsboard.io"; | |
| // Reads the access token from arguments | |
| const accessToken = process.argv[2]; | |
| // Default topics. See http://thingsboard.io/docs/reference/mqtt-api/ for more details. | |
| const attributesTopic = 'v1/devices/me/attributes'; |
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
| ################################################################################ | |
| # Prevent OSX calling home # | |
| # # | |
| # Mix of different /etc/hosts files found over internet, and calls filtered # | |
| # using LittleSnitch for months. # | |
| # # | |
| # OSX sends a huge amount of requests to Cuppertino, even when you don't use # | |
| # Spotlight suggestions, iCloud, updates and other services. Even if they are # | |
| # disabled. # | |
| # # |
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 | |
| /** | |
| * Hide the "In stock" message on product page. | |
| * | |
| * @param string $html | |
| * @param string $text | |
| * @param WC_Product $product | |
| * @return string | |
| */ | |
| function my_wc_hide_in_stock_message( $html, $text, $product ) { |
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
| import urlparse | |
| import oauth2 as oauth | |
| consumer_key = '' | |
| consumer_secret = '' | |
| request_token_url = 'http://www.tumblr.com/oauth/request_token' | |
| access_token_url = 'http://www.tumblr.com/oauth/access_token' | |
| authorize_url = 'http://www.tumblr.com/oauth/authorize' | |
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
| <?xml version="1.0"?> | |
| <root> | |
| <item> | |
| <name>My Mouse Settings</name> | |
| <item> | |
| <name>FFF Tilt Wheel to Back Forward (Command+[, Command+])</name> | |
| <identifier>remap.my_tilt_wheel_to_back_forward</identifier> | |
| <autogen> | |
| __ScrollWheelToKey__ ScrollWheel::LEFT, ModifierFlag::NONE, |
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
| #!/usr/bin/env perl | |
| # | |
| # taken from https://stackoverflow.com/a/1075807/1972627 (Daniel Reeves) | |
| # slightly modified by tom hensel <tom@jitter.eu> | |
| # https://gist.github.com/gretel/c2ef247f51e3cf0c654e | |
| # | |
| # Use 'ssc' (this script) instead of 'ssh' to do your ssh logins. | |
| # Without a 3rd argument it will list available screens. | |
| # Given a 3rd argument it will either reattach an existing screen or create a new screen, | |
| # i.e. 'ssc host.tld session'. |
NewerOlder