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
DELETE | |
FROM wp_postmeta | |
WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'shop_order' AND YEAR(post_date) != YEAR(NOW())); | |
DELETE | |
FROM wp_commentmeta | |
WHERE comment_id IN (SELECT comment_ID | |
FROM wp_comments | |
WHERE comment_post_id IN | |
(SELECT ID FROM wp_posts WHERE post_type = 'shop_order' AND YEAR(post_date) != YEAR(NOW())) |
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
awesome-client 'awful=require("awful");awful.spawn(terminal, {tag = mouse.screen.selected_tag})' |
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 | |
ffmpeg -rtsp_transport tcp \ | |
-i rtsp://smartiptv:PASSWORD@192.168.2.3/Streaming/Channels/102 \ | |
-i rtsp://smartiptv:PASSWORD@192.168.2.3/Streaming/Channels/202 \ | |
-i rtsp://smartiptv:PASSWORD@192.168.2.3/Streaming/Channels/302 \ | |
-i rtsp://smartiptv:PASSWORD@192.168.2.3/Streaming/Channels/402 \ | |
-i rtsp://smartiptv:PASSWORD@192.168.2.3/Streaming/Channels/502 \ | |
-i rtsp://smartiptv:PASSWORD@192.168.2.3/Streaming/Channels/602 \ | |
-filter_complex " |
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 DivYieldTtm(ticker) { | |
var ticker = ticker || "GOOG"; | |
ticker = encodeURI(ticker); | |
var response = UrlFetchApp.fetch("https://fmpcloud.io/api/v3/ratios-ttm/" + ticker + "?apikey=YOUR_API_KEY"); | |
var result = JSON.parse(response.getContentText()); | |
return parseFloat(result[0].dividendYielTTM); | |
} |
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 YahooFinance(ticker) { | |
var ticker = ticker || "GOOG"; | |
ticker = encodeURI(ticker); | |
var response = UrlFetchApp.fetch("https://query2.finance.yahoo.com/v7/finance/options/" + ticker); | |
var chain = JSON.parse(response.getContentText()); | |
return parseFloat(chain.optionChain.result[0].quote.regularMarketPrice); | |
} |
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
$ cat /etc/profile.d/ssh-login-notify.sh | |
if [ -n "$SSH_CLIENT" ]; then | |
TEXT="$(date): ssh login to ${USER}@$(hostnamectl --static)" | |
TEXT="$TEXT from $(echo $SSH_CLIENT|awk '{print $1}')" | |
echo $TEXT|mail -s "ssh login" info@example.com | |
fi |
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 pn_woocommerce_product_query( WP_Query $wp_query ) { | |
if ( $wp_query->get( 'orderby' ) == 'menu_order title' ) { | |
$wp_query->set( 'meta_query', [ | |
'relation' => 'AND', | |
'internal_stock' => [ | |
'key' => '_manage_stock', | |
'compare' => 'EXIST', | |
], | |
'stock_status' => [ | |
'key' => '_stock_status', |
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
BEGIN:VCALENDAR | |
VERSION:2.0 | |
BEGIN:VEVENT | |
RRULE:FREQ=YEARLY;BYMONTH=5;BYDAY=1SU | |
SUMMARY:Mother day in Hungary | |
DTSTART;VALUE=DATE:20190101 | |
SEQUENCE:0 | |
DESCRIPTION: | |
END:VEVENT | |
END:VCALENDAR |
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
version: "3.2" | |
services: | |
wordpress: | |
image: wordpress | |
volumes: | |
- type: volume | |
source: www-data | |
target: /var/www/html | |
expose: | |
- 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
<?php | |
/** | |
* Returns UNIX timestamp from a NTP server (RFC 5905) | |
* | |
* @param string $host Server host (default is pool.ntp.org) | |
* @param integer $timeout Timeout in seconds (default is 10 seconds) | |
* @return integer Number of seconds since January 1st 1970 | |
*/ | |
function getTimeFromNTP($host = 'pool.ntp.org', $timeout = 10) |