Skip to content

Instantly share code, notes, and snippets.

View artursopelnik's full-sized avatar
🏠
Working from home

Artur Sopelnik artursopelnik

🏠
Working from home
View GitHub Profile
/**
* Parallax
*
* Translate3d
*
* 1.0 | Muffin Group
*/
var mfnSetup = {
translate: null
@artursopelnik
artursopelnik / responsive-embed.css
Created January 2, 2019 16:50
responsive-embed 16:9
.responsive-embed {
position: relative;
height: 0;
margin-bottom: 1rem;
padding-bottom: (9 / 16) * 100%;
overflow: hidden;
iframe,
object,
embed,
video {
@artursopelnik
artursopelnik / taxonomy manager
Created September 7, 2018 14:33
wordpress taxonomy manager
<?php
if (!function_exists('custom_post_type')) {
// Register Custom Post Type
function custom_post_type()
{
$labels = array(
'name' => _x('Houseplans', 'Post Type General Name', 'twentysixteen'),
@artursopelnik
artursopelnik / cookieconsent-create-height-for-fixed-popup.html
Last active July 20, 2018 16:19
Cookie Consent - Create height for fixed popup with vanilla javascript
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function () {
var wrapper = document.body,
cookieBarOptions = {
"palette": {
"popup": {
"background": "#000"
},
@artursopelnik
artursopelnik / jquery.tinypubsub.js
Created July 19, 2018 10:22
jQuery Tiny Pub/Sub - v0.8
/* jQuery Tiny Pub/Sub - v0.8 - 07/19/2018
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
<?php
add_action('add_meta_boxes', 'add_country_name_meta_box');
function add_country_name_meta_box()
{
add_meta_box(
'country_name_meta_box',
__('Widget Title', 'theme_name'),
'add_country_name_meta_box_callback', // Prints the box content
'post', // $page
$('select').val('VALUE').trigger('change');
@artursopelnik
artursopelnik / _fa-variables.scss
Last active May 16, 2022 01:49
Font Awesome 4.7.0 - Variables without quotes | Read more: https://github.com/sass/sass/issues/1395#issuecomment-65548751
$fa-var-500px: \f26e;
$fa-var-address-book: \f2b9;
$fa-var-address-book-o: \f2ba;
$fa-var-address-card: \f2bb;
$fa-var-address-card-o: \f2bc;
$fa-var-adjust: \f042;
$fa-var-adn: \f170;
$fa-var-align-center: \f037;
$fa-var-align-justify: \f039;
$fa-var-align-left: \f036;
// input[type="reset"] sucks. Do it manually
$(':input', this.form).each(function () {
var type = this.type,
tag = this.tagName.toLowerCase();
if (type == 'text' || type == 'search' || type == 'password' || tag == 'textarea') {
this.value = "";
} else if (type == 'checkbox' || type == 'radio') {
this.checked = false;
function parseQueryString () {
var str = window.location.search,
objURL = {},
isArray = _.isArray,
first;
str.replace(
new RegExp('([^?=&]+)(=([^&]*))?', 'g'),
function ($0, $1, $2, $3) {
if (objURL[$1] && !isArray(objURL[$1])) {