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
@calvez
calvez / wp-max-post-loop.php
Created March 29, 2017 09:55
wordpress snippets
<?php
global $query_string;
query_posts( $query_string . '&posts_per_page=4' );
?>
@calvez
calvez / header.html
Created March 9, 2017 14:05
autoversion
<link href="<?php autoversion('/path/to/theme.css'); ?>" rel="stylesheet">
SELECT instr, SUM(qty*execprice+fee) FROM orders
WHERE `stamp` >= '2017-02-27 09:03:00'
#vagy
#WHERE stamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE()
and
status='filled'
GROUP BY instr;
{
"data": [
[
"Tiger Nixon",
"System Architect",
"Edinburgh",
"5421",
"2011/04/25",
"$320,800"
],
~ ⌚ 17:57:42
$ dig @8.8.8.8 shop.leanderkills.hu ‹system›
; <<>> DiG 9.10.3-P4-Ubuntu <<>> @8.8.8.8 shop.leanderkills.hu
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 65378
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
@calvez
calvez / gist:980195eeb07aea0cb85b5a5dc522e989
Created February 11, 2017 11:32 — forked from mikejolley/gist:6713608
WooCommerce Shipping Method Skeleton Plugin
<?php
/*
Plugin Name: Your Shipping plugin
Plugin URI: http://woothemes.com/woocommerce
Description: Your shipping method plugin
Version: 1.0.0
Author: WooThemes
Author URI: http://woothemes.com
*/
@calvez
calvez / gist:a2aab955fb979e288b7c7fcb9f7faf80
Created January 6, 2017 16:35
Facebook Javascript SDK Demo
<!--
Facebook Javascript SDK Demo
Refs:
https://developers.facebook.com/docs/javascript/quickstart/v2.0
http://hayageek.com/facebook-javascript-sdk/
http://pt.slideshare.net/littleq0903/introduction-to-facebook-javascript-sdk-new
https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0
http://pivotallabs.com/working-with-asynchronously-loaded-javascript/
wp plugin install disable-comments custom-post-type-ui search-and-replace wordpress-seo wp-security-audit-log duplicate-post enable-media-replace simple-page-ordering

Keybase proof

I hereby claim:

  • I am calvez on github.
  • I am calvez (https://keybase.io/calvez) on keybase.
  • I have a public key ASDUISUmPw9FSmojlhizDH5-UeQIIlgrrB27J-018gNumgo

To claim this, I am signing this object:

@calvez
calvez / wp_update.sh
Created December 4, 2016 21:23 — forked from MiteshShah/wp_update.sh
Update Multiple WordPress
#!/bin/bash
# Define Variables
WEB_ROOT=/var/www
WEB_ROOT_PREFIX=htdocs
WEB_ROOT_GROUP=www-data
WP_UPDATE_LOGS=/var/log/setup/wp-update.log
# Capture Errors
function OwnError() {