Skip to content

Instantly share code, notes, and snippets.

View calvez's full-sized avatar
🏠
Working from home

calvez calvez

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
find . -iname '*.php' -mmin -$(echo $(date +%s) - $(date +%s -d"Apr 25, 2018 00:00:01") | bc -l | awk '{print $1 / 60}' ) -mmin +$(echo $(date +%s) - $(date +%s -d"May 3, 2018 23:59:59") | bc -l | awk '{print $1 / 60}' ) -exec ls -ld --time-style=full-iso {} \; > ~/getthisfucker/maybemodified.txt
// Found at:
// https://github.com/wp-cli/wp-cli/issues/1734#issuecomment-87897943
//
// Note that $_SERVER['DOCUMENT_ROOT'] will return a string with a trailing slash on
// some systems and not others, so we'll make sure it's gone in all cases where there
// is ambiguity by using rtrim.
// Also note that this is above the loading of the wp-config-*.php files so that these can
// be over-ridden as required.
<?php /* php tag is just for gist highlight*/
if (!empty($badusers)) {
foreach ($badusers as $bu) {
$output .= "PROBLEM with uid [<b>".$bu['userid']."</b>]: freemoney [<b>".n($bu['freemoney'])."</b>] should be [<b>".n($bu['calculated'])."</b>], diff is [<b>".n(abs($bu['freemoney']-$bu['calculated']))."</b>]<br/>\n";
if ($bu['calculated'] >= 0) {
if (!$sim) {
$conn->execute('update betusers set freemoney = '.$bu['calculated'].' where userid = '.$bu['userid']);
}
$output .= "Fixed with sql update.<br />\n";
} else {
$output .= "Negative value, not fixed, check manually!<br />\n";
@calvez
calvez / wpup.sh
Created January 30, 2018 21:31
/usr/local/bin/wpup
#!/bin/bash
timestamp1=$(date "+%Y%m%d-%H%M%S")
RED=`tput setaf 1`
GREEN=`tput setaf 2`
NC=`tput sgr0`
echo "Database backup"
wp db export
echo -e "${RED}Update Wordpress core...${NC}\n"
$('.valuefield').each(function() {
var elem = $(this);
// Save current value of element
elem.data('oldVal', elem.val());
// Look for changes in the value
elem.bind("propertychange change click keyup input paste", function(event){
// If value has changed...
@calvez
calvez / asztronauta.css
Created November 28, 2017 09:48
asztronauta css módosításai
/*
Itt adhatunk meg saját CSS kódot.
Kattintsunk a fenti segítség ikonra a további információkhoz.
*/
.widget_shopping_cart .total, .shop_table.woocommerce-checkout-review-order-table .cart-subtotal th, .shop_table.woocommerce-checkout-review-order-table .cart-subtotal td, .cart_totals table .cart-subtotal th, .cart_totals table .order-total th, .shop_table thead th, .cmsmasters_single_product .product_meta a, .cmsmasters_product .cmsmasters_product_title a, .cmsmasters_product_cat a, .woocommerce-info, .woocommerce-message, .woocommerce-error li, #page .remove, .cmsmasters_woo_wrap_result .woocommerce-result-count, .cmsmasters_product .cmsmasters_product_cat, .shop_attributes th, .shop_table .product-name a, ul.order_details strong, .widget_layered_nav ul li, .widget_layered_nav ul li a, .widget_layered_nav_filters ul li, .widget_layered_nav_filters ul li a, .widget_product_categories ul li, .widget_product_categories ul li a, .widget > .product_list_widget a, .widget > .product_list_widget .amount, .widge
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@aiee.eu
ServerName asztronauta.com
ServerAlias www.asztronauta.com
DocumentRoot /home/websites/web/asztronauta.com
<Directory />
AllowOverride All
</Directory>
<Directory /home/websites/web/asztronauta.com>
@calvez
calvez / drupal-theme-hooks.php
Last active November 22, 2017 14:40
drupal theme hooks for bdo
// img snippet
<img src="<?php print file_create_url($node->field_image[LANGUAGE_NONE][0]['uri']); ?>" />
<div class="container-fluid" style="background-image:url('<?php echo file_create_url($node->field_image[LANGUAGE_NONE][0]['uri']);?>');">
// img a coverhez váltoizóval style-t kérve
<?php
$image_uri = $node->field_image[LANGUAGE_NONE][0]['uri']; // or any public://my_image
@calvez
calvez / wp-secure-admin.md
Created November 16, 2017 13:06
átírja a wp default wp admin urljét

Steps:

  1. Add constant to wp-confing.php

define('WP_ADMIN_DIR', 'secret-folder'); define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR); 2. Add below filter to functions.php

add_filter('site_url', 'wpadmin_filter', 10, 3); function wpadmin_filter( $url, $path, $orig_scheme ) {

@calvez
calvez / zenbot-test.md
Last active October 1, 2017 15:11
zenbot trader settings

paper trader ./zenbot.sh trade --paper bittrex.BTC-USDT --period=10m --strategy=rsi --trend_ema=15 --profit_stop_enable_pct=10

live trader on bittrex, 2017-10-01 ./zenbot.sh trade bittrex.QTUM-BTC --period=3m --strategy=rsi --trend_ema=15 --profit_stop_enable_pct=10 // results