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:0cbcf767175e651d41b04df94c5acb48
Last active March 28, 2017 12:49
MariaDB- useful commands
Export database: mysqldump -u username -p database_name > data-dump.sql
Import database: mysql -u username -p new_database < data-dump.sql
Specify different port number: mysql -P 3308 -u root -p
<?php echo '<br/>', count(get_included_files()), ' PHP files were required to generate this page.<br/>';?>
@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':
mysqldump -u root -p db_name > whatever-dump.sql
mysql -p -u user_name database_name < file.sql
@rolka
rolka / forget.mercurial
Created November 9, 2016 14:06
Forget file previously added to Mercurial
hg forget test.html
<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);