Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
work from home

Sergey Mochalov proweb

🏡
work from home
View GitHub Profile
@adidac
adidac / joomlaPermission.sh
Created Dec 21, 2012
Ubuntu Joomla File Folder Recursive Permission Set
View joomlaPermission.sh
find /var/www/joomla -type f -exec chmod 0644 {} \;
find /var/www/joomla -type d -exec chmod 0755 {} \;
@shazdeh
shazdeh / gist:8188033
Created Dec 30, 2013
Change default parameters of the gallery shortcode, disable links by default
View gist:8188033
<?php
function gallery_shortcode_defaults( $out, $pairs, $atts ) {
$out['link'] = 'none';
return $out;
}
add_filter( 'shortcode_atts_gallery', 'gallery_shortcode_defaults', 10, 3 );
View openssl.sh
#!/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
@Jonathonbyrd
Jonathonbyrd / wp_get_post_parent.php
Created Aug 11, 2011
This is a wordpress function that will return the parent of the current page.
View wp_get_post_parent.php
<?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
@soderlind
soderlind / change-theme-root.php
Last active Jan 21, 2017
Change WordPress theme root to a folder in your plugin (src/assets)
View change-theme-root.php
<?php
/**
* Sample use:
* WordPres Customizer is dependant on functionality in the theme. Just in case
* the current theme doesn't support WordPress Customizer we'll use a theme
* that supports it.
*/
class NN {
private $theme_name = 'twentysixteen';
View gist:090d857c58f555fe0af966ec5cd9431f
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 Jul 17, 2017
Snippet of Security Tweaks for the .htaccess.
View .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
This script converts the headers from wp2md to Grav headers format
View wpmd 2 grav
#! /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 #
@MatthieuScarset
MatthieuScarset / gist:47b57f2e3bd4afee39a81ae5a7c3dc28
Created Dec 27, 2016
Drupal 8 - Get canonical node URL in TWIG
View gist:47b57f2e3bd4afee39a81ae5a7c3dc28
{{ path('entity.node.canonical', {'node': node.id }) }}
@leurdo
leurdo / gist:c81f10472cfdd403cf608068b0f054d7
Last active Sep 9, 2018
wiki post type and taxonomy registration, gives permalink structure http://site.ru/wiki/category/subcategory/post
View gist:c81f10472cfdd403cf608068b0f054d7
<?php
// don't load directly
if (!defined('ABSPATH')) die('-1');
class CreditznatokAddwiki
{
private static $_instance;
static function getInstance()
You can’t perform that action at this time.