Skip to content

Instantly share code, notes, and snippets.

@rolka
rolka / vertical-text.css
Created September 26, 2018 19:48 — forked from obenjiro/vertical-text.css
CrossBrowser Vertical CSS Text
/**
* Works everywere ( IE7+, FF, Chrome, Safari, Opera )
* Example: http://jsbin.com/afAQAWA/2/
*/
.rotated-text {
display: inline-block;
overflow: hidden;
width: 1.5em;
}
.rotated-text__inner {
@rolka
rolka / functions.php
Created August 19, 2018 19:00 — forked from caralgar/functions.php
How to remove Category:, tag:, etc from the_archive_title()
<?php
add_filter( 'get_the_archive_title', function ($title) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = '<span class="vcard">' . get_the_author() . '</span>' ;
}
return $title;
@rolka
rolka / script.js
Created August 10, 2018 11:18 — forked from athlonUA/script.js
Google reCAPTCHA V2. Change language in real time
// Enum for language codes
var languageListsGoogleCaptchaEnum = {
Arabic: 'ar',
Afrikaans: 'af',
Amharic: 'am',
Armenian: 'hy',
Azerbaijani: 'az',
Basque: 'eu',
Bengali: 'bn',
Bulgarian: 'bg',
@rolka
rolka / gist:b5c37228f0ce56889f39dee7968b73f5
Created February 27, 2017 08:09 — forked from oscarnascimento/gist:17e98e84012e9d11311fea10ff7eda3a
Wordpress wp-config.php MUTIPLE ENVIRONMENT
/*------------------------------------------------------------------------------------------
* WORPDRESS MULTIPLE ENVIRONMENT
*-----------------------------------------------------------------------------------------*/
//GET HOSTNAME INFO
$hostname = $_SERVER['SERVER_NAME'];
//VERIFY WHICH ENVIRONMENT THE APP IS RUNNING
switch ($hostname) {
case 'development.dev':
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
app/etc/local.xml
downloader/.cache
downloader/cache.cfg
downloader/connect.cfg
var/cache
var/session
var/locks
var/package
var/importexport
var/log
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
$coupon_code = 'UNIQUECODE'; // Code
$amount = '10'; // Amount
$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product
$coupon = array(
'post_title' => $coupon_code,
'post_content' => '',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'shop_coupon'
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Sale!' :
$translated_text = __( 'Clearance!', 'woocommerce' );