Skip to content

Instantly share code, notes, and snippets.

View proweb's full-sized avatar

Sergey Mochalov proweb

View GitHub Profile
@biswarupadhikari
biswarupadhikari / joomlaPermission.sh
Created December 21, 2012 12:03
Ubuntu Joomla File Folder Recursive Permission Set
find /var/www/joomla -type f -exec chmod 0644 {} \;
find /var/www/joomla -type d -exec chmod 0755 {} \;
@shazdeh
shazdeh / gist:8188033
Created December 30, 2013 20:58
Change default parameters of the gallery shortcode, disable links by default
<?php
function gallery_shortcode_defaults( $out, $pairs, $atts ) {
$out['link'] = 'none';
return $out;
}
add_filter( 'shortcode_atts_gallery', 'gallery_shortcode_defaults', 10, 3 );
#!/usr/bin/env sh
------------------------------------------
openssl genrsa -out jbzoo-com-ca.key 2048
openssl req -x509 -new -key jbzoo-com-ca.key -days 10000 -out jbzoo-com-ca.crt
openssl genrsa -out jbzoo-com-server.key 2048
openssl req -new -key jbzoo-com-server.key -out jbzoo-com-server.csr
openssl x509 -req -in jbzoo-com-server.csr -CA jbzoo-com-ca.crt -sha256 -CAkey jbzoo-com-ca.key -CAcreateserial -out jbzoo-com-server.crt -days 5000
@jonathonbyrdziak
jonathonbyrdziak / wp_get_post_parent.php
Created August 11, 2011 19:12
This is a wordpress function that will return the parent of the current page.
<?php
/**
* Function is responsible for returning the parent of the current
* page.
*
* This function should be placed in your functions.php file, or equivalent
*
* @param unknown_type $post
* @return object
@denysdesign
denysdesign / gist:090d857c58f555fe0af966ec5cd9431f
Last active May 11, 2017 07:46
Joomla! calendar + UIKIT 3
jQuery(document).ready(function () {
// calendar
uikit_jcalendar();
// button
uikit_jcalendar_btn('#news_created_btn', 'uk-button-primary', 'calendar');
uikit_jcalendar_btn('#news_publish_up_btn', 'uk-button-secondary', 'future');
});
// calendar
@stephensabatini
stephensabatini / .htaccess
Created July 17, 2017 18:22
Snippet of Security Tweaks for the .htaccess.
# Deny access to include files.
<Files ~ "\.inc$">
Order Allow,Deny
Deny from All
</Files>
# Deny access to hidden files.
RedirectMatch 403 /\..*$
# Deny access to folders.
@tmos
tmos / wpmd 2 grav
Last active May 1, 2018 19:19
This script converts the headers from wp2md to Grav headers format
#! /bin/bash
#####################################################################################################
# == wpmd 2 grav == #
# This script converts the headers from wp2md to Grav headers format #
# wp2md : https://github.com/dreikanter/wp2md ; with `wp2md -d ./ export.xml -ps {title}/item.md` #
# Grav : http://getgrav.org/ #
# @author : Tom Canac http://tomcanac.com/ #
# @version : 0.1 #
# @licence : CC-BY #
@leurdo
leurdo / gist:c81f10472cfdd403cf608068b0f054d7
Last active September 9, 2018 14:03
wiki post type and taxonomy registration, gives permalink structure http://site.ru/wiki/category/subcategory/post
<?php
// don't load directly
if (!defined('ABSPATH')) die('-1');
class CreditznatokAddwiki
{
private static $_instance;
static function getInstance()
@neilgee
neilgee / jetpack-all-modules.php
Last active May 5, 2019 13:08
Remove JetPack CSS
<?php
//Do not copy the above php tag
// Stop JetPacks Minified/Concatention CSS file
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
//Remove JepPack CSS
function themeprefix_remove_jetpack_css() {
wp_deregister_style( 'AtD_style' ); // After the Deadline
wp_deregister_style( 'jetpack_likes' ); // Likes
@dongilbert
dongilbert / namespace.php
Last active May 12, 2019 11:25
Joomla Namespace Compatibility Layer
<?php
return array(
'JAccess' => 'Joomla\\Access\\Access',
'JAccessRule' => 'Joomla\\Access\\Rule',
'JAccessRules' => 'Joomla\\Access\\Rules',
'JApplicationBase' => 'Joomla\\Application\\Base',
'JApplicationCli' => 'Joomla\\Application\\Cli',
'JApplicationDaemon' => 'Joomla\\Application\\Daemon',
'JRoute' => 'Joomla\\Application\\Route',