Skip to content

Instantly share code, notes, and snippets.

View gaintsev's full-sized avatar
🎯
Focusing

gaintsev gaintsev

🎯
Focusing
View GitHub Profile
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('../fonts/material-icons/materialicons-regular.woff2') format('woff2'),
url('../fonts/material-icons/materialicons-regular.woff') format('woff'),
url('../fonts/material-icons/materialicons-regular.ttf') format('truetype');
}
.material-icons {
@gaintsev
gaintsev / css-3d-box.pcss
Last active July 26, 2016 10:38
A simple snippet which allows to build a CSS 3D box with the given dimensions. Used PostCSS and CSSNext.
/*
A simple snippet which allows to build a CSS 3D box with the given dimensions.
Used PostCSS and CSSNext.
Source: https://gist.github.com/gaintsev/e054f05fb67909a82244fd5e026b377a
*/
:root {
/*Set Box Sizes*/
--boxWidth: 260px;
--boxHeight: 400px;
@gaintsev
gaintsev / hard-reset.css
Last active April 19, 2016 11:42
Future CSS Hard Reset
/*
Future CSS Hard Reset
Source: https://gist.github.com/gaintsev/ff039fe39f633d64178273537684292f
*/
html * {
all: initial;
cursor: default;
font-family: inherit;
font-weight: inherit;
text-align: inherit;
@gaintsev
gaintsev / wget-site-load
Created April 14, 2016 18:26
Downloading an Entire Web Site
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains example.com \
--no-parent \
www.example.com/some/page/
@gaintsev
gaintsev / yandex-translate.sh
Created February 21, 2016 00:54
Yandex.Translate shell script
#!/bin/bash
# Dependencies:
# ------------
# xclip — read/write to clipboard
# jq — parse JSON
apiKey="" # Yandex API key, see here https://tech.yandex.ru/keys/get/?service=trnsl
firstLang=$1
lastLang=$2
@gaintsev
gaintsev / check-if-in-view.js
Created February 9, 2016 21:13
jQuery detect element in view on scroll
var $animationElements = $('.animate');
var $window = $(window);
function checkIfInView() {
var windowHeight = $window.height();
var windowTopPosition = $window.scrollTop();
var windowBottomPosition = (windowTopPosition + windowHeight);
$.each($animationElements, function() {
var $element = $(this);
var elementHeight = $element.outerHeight();
@gaintsev
gaintsev / Duplicate Me!.js
Last active February 4, 2016 13:25
Demonstration Photoshop script that allows you to quickly make copies of objects and arrange them in the correct order.
/**
*
* Duplicate Me!
* Copyright: (c)2016. Vladimir Gaintsev, [email protected]. All rights reserved.
*
*/
/*=============================================
= Check Active Document =
=============================================*/
@gaintsev
gaintsev / imagemagick-crop-and-resize.sh
Last active November 11, 2015 14:44
Imagemagick Crop and Resize
#!/bin/sh
DIRECTORY="thumbnails"
if [ ! -d "$DIRECTORY" ]; then
mkdir "$DIRECTORY"
fi
for i in *.jpg; do
convert $i -resize 300x225^ -gravity center -crop 300x225+0+0 thumbnails/$(basename $i);
@gaintsev
gaintsev / wp-custom-post-capabilities.php
Created September 3, 2015 07:47
Wordpress Custom Post Type Capabilities (admin only)
<?php
function add_test_type()
{
$labels = array(
'name' => _x('Тест', 'test'),
'singular_name' => _x('Тест', 'test'),
'menu_name' => _x('Тест', 'test'),
'name_admin_bar' => _x('Тест', 'test'),
'add_new' => _x('Добавить новый', 'test'),
@gaintsev
gaintsev / get-window-name
Created September 1, 2015 17:51
Linux get window name
xprop |awk '/WM_CLASS/{print $4}'