Skip to content

Instantly share code, notes, and snippets.

View veirus's full-sized avatar

Alex veirus

View GitHub Profile
@veirus
veirus / random_colorscheme.vim
Last active May 29, 2017 10:23
Set random colorscheme for yer Vim
function! SetRandomColors()
if !exists('g:mycolors')
let matches = {}
for fname in split(globpath(&runtimepath, 'colors/*.vim'), '\n')
let name = fnamemodify(fname, ':t:r')
let matches[name] = 1
endfor
let g:mycolors = sort(keys(matches), 1)
endif
exe 'colorscheme ' . g:mycolors[localtime() % len(g:mycolors)]
@veirus
veirus / Copy text directly from Photoshop text layer.
Created June 7, 2017 09:13 — forked from praveenvijayan/Copy text directly from Photoshop text layer.
Copy text directly from text layer. Works above photoshop cs6. Copy following script file into /Applications/Adobe Photoshop CC 2014/Presets/Scripts (MAC) or C:\Program Files\Adobe\Adobe Photoshop CC 2014\Presets\Scripts (WIN). Assign shortcut for easy access (cmd+option+c / ctrl+alt+c)
/*****************************************************************
*
* Copy Layer text 1.0 - by Praveen Vijayan! - http://www.decodize.com/
*
* Compatibility above Photoshop CS6
*
* Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
*
*****************************************************************/
@veirus
veirus / hide_ymaps.css
Created June 14, 2017 07:15
Hide yandex maps overlay controls via CSS
.gotoymaps,
.ymaps-2-1-50-map-copyrights-promo,
.ymaps-2-1-50-copyright
{
display: none !important;
}
<snippet>
<content><![CDATA[
<!-- begin $1 -->
<div class="$1">
$2
</div>
<!-- end $1 -->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>di</tabTrigger>
@veirus
veirus / cvimrc
Last active September 14, 2017 06:17
config for cvim chrome extension
" cvim config v.0.0.1
map gr gT
map gb :buffer<Space>
"==================================================
" russian langmap for hotkeys to work in both kb layouts
" credit: https://gist.github.com/rynffoll/7bb30a47b3b8d39687f588ecc2be5425
" also: https://gist.github.com/MaxLevs/f519d361d3946d6d877085f909e13043
let langmap = "Ё|АFБ<ВDГUДLЕTЖ:ЗPИBЙQКRЛKМVНYОJПGРHСCТNУEФAХ{ЦWЧXШIЩOЪ}ЫSЬMЭ\"Ю>ЯZаfб\\,вdгuдlеtж\\;зpиbйqкrлkмvнyоjпgрhсcтnуeфaх[цwчxшiщoъ]ыsьmэ'ю.яzё\\№#"
"==================================================
let blacklists = ["http://www.typing.com/*","http://www.heuxasoftware.com/*","http://www.keybr.com/*","http://www.reddit.com/*","https://sirxemic.github.io/*","http://vim-adventures.com/*","https://mail.google.com/*","https://timeinvariant.github.io/*","http://www.platinumgames.co.jp/*","http://codecombat.com/*","http://johanw123.nu/*","http://hughsk.io/*","https://np.reddit.com/*","chrome-extension://hgimloonaobbeeagepickockgdcghfnn/*","https://blastar-1984.appspot.com/*","http://redditp.com/*",
nav.nav.header__nav
li.nav__item(class=page.name === 'home' ? 'active' : ''): a.nav__btn.ico.ico--flat(href="/")
.label Квартира
li.nav__item(class=page.name === 'house' ? 'active' : ''): a.nav__btn.ico.ico--house(href="#")
.label Дом
li.nav__item(class=page.name === 'garage' ? 'active' : ''): a.nav__btn.ico.ico--garage(href="#")
.label Гараж
li.nav__item(class=page.name === 'unfinished' ? 'active' : ''): a.nav__btn.ico.ico--unfinished(href="#")
.label Недостроенные объекты
li.nav__item(class=page.name === 'share' ? 'active' : ''): a.nav__btn.ico.ico--share(href="#")
.credits
{
display: inline-block;
float: right;
color: var(--cl-credit);
}
.prostor
{
color: var(--cl-credit);
@veirus
veirus / visually-hidden.css
Created August 8, 2017 11:55
visually-hidden - hard version
.visually-hidden {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
@veirus
veirus / show_tax_id.php
Created October 13, 2017 10:01
Show taxonomy ID in wordpress admin panel
// show tax id's in admin panel:
// https://wordpress.stackexchange.com/a/77536
foreach ( get_taxonomies() as $taxonomy ) {
add_action( "manage_edit-${taxonomy}_columns", 't5_add_col' );
add_filter( "manage_edit-${taxonomy}_sortable_columns", 't5_add_col' );
add_filter( "manage_${taxonomy}_custom_column", 't5_show_id', 10, 3 );
}
add_action( 'admin_print_styles-edit-tags.php', 't5_tax_id_style' );
function t5_add_col( $columns )
@veirus
veirus / wp_disable_autoformat.php
Last active October 17, 2017 09:19
Disable autoformatting in the Wordpress post editor
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_content', 'wptexturize' );
remove_filter( 'the_excerpt', 'wpautop' );
remove_filter( 'comment_text', 'wpautop' );