Skip to content

Instantly share code, notes, and snippets.

View ladislavsulc's full-sized avatar

Ladislav Šulc ladislavsulc

View GitHub Profile
@ladislavsulc
ladislavsulc / SassMeister-input.scss
Created January 2, 2015 20:21
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
/**
* Provides Box model helpers classes.
*
* @param {List} $sizes
*
@ladislavsulc
ladislavsulc / SassMeister-input-HTML.html
Created February 10, 2015 18:57
Generated by SassMeister.com.
<div class="shadow"></div>
@ladislavsulc
ladislavsulc / color.scss
Created September 24, 2015 17:25 — forked from AllThingsSmitty/color.scss
Use Sass to dynamically change text color based on background color
@function set-notification-text-color($color) {
@if (lightness( $color ) > 50) {
@return #000; // lighter color, return black
}
@else {
@return #fff; // darker color, return white
}
}
$confirm: hsla(101, 72%, 37%, 1); // green
<?php if ( have_posts() ) : ?>
<?php
/**Get all of the data about the author from the WordPress and Pods generated user profile fields.**/
//First get the_post so WordPress knows who's author page this is
the_post();
//get the author's meta data and store in array $user
$user = get_userdata( get_the_author_meta('ID') );
//Escape all of the meta data we need into variables
$name = esc_attr($user->user_firstname) . '&nbsp;' . esc_attr($user->user_lastname);
@ladislavsulc
ladislavsulc / gist:4cbff9ee0b95e21ffce62d2ef2bfe21c
Last active February 22, 2017 21:17
RSYNC (SSH from local to remote using different port) - exclude .git
rsync -avz --exclude='.git/' "ssh -p 2824" /mnt/c/local_dir/ username@remote_host:/remote_dir/
# exclude .env file
rsync -avz --exclude='.git/' --exclude='.env' "ssh -p 2824" /mnt/c/local_dir/ username@remote_host:/remote_dir/
@ladislavsulc
ladislavsulc / index.html
Created March 1, 2017 23:17
Scheme Animation
<div class="container mt-5em">
<svg viewBox="0 0 1170 352" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.41">
<path d="M1170 116c0-2.76-2.24-5-5-5H875c-2.75 0-5 2.24-5 5v71c0 2.76 2.25 5 5 5h290c2.76 0 5-2.24 5-5v-71z" fill="#F5F5F5"/>
<path d="M1165.07 111h.28l.05.02h.19l.06.02h.07l.07.02h.06l.07.02h.05l.06.02.08.02h.06l.05.02.05.02h.07l.06.03h.05l.07.03h.05l.06.03.06.02.07.02.05.03.06.02.12.04.1.04.1.05.13.05.1.05.1.06.1.06.1.07.1.06.1.06.1.07.1.07.08.07.1.08.1.08.07.08.1.1.08.07.08.1.08.08.1.1.06.08.07.1.1.1.05.1.07.1.06.1.06.1.07.12.06.1.05.1.06.12.05.12.06.1.02.07.02.05.03.06v.06l.04.06v.05l.03.07.02.06v.06l.03.05.02.06v.07l.02.06v.06l.02.05v.07l.02.06v.06l.02.06v.13l.02.06v.05l.02.07v71.76l-.02.07v.2l-.02.06-.02.06v.13l-.02.05v.06l-.03.07-.02.06v.06l-.03.05-.02.06v.07l-.03.06-.02.06v.05l-.04.05v.06l-.04.06-.02.06-.02.05-.05.12-.04.1-.05.12-.04.1-.05.1-.06.12-.06.1-.06.1-.07.1-.06.1-.1.1-.06.1-.07.08-.1.1-.06.08-.07.1-.1.08-
@ladislavsulc
ladislavsulc / Chromebook_setup.md
Created March 4, 2017 22:56 — forked from rachelmyers/Chromebook_setup.md
How I set up my Chromebooks' dev environment

Chromebook Setup Options

Option 1: Stay in Chrome OS

If you're writing bare-bones javascript for the browser, creating Chrome Apps and Extensions, or using remote coding apps like cloud9, Koding, or Nitrous, you may not need to install Ubuntu. Some tutorials can be done entirely within the browser. The tradeoff is that you won't have a full-featured command line, and you may hit a point where you can't install something that you need.

To start coding within Chrome OS, install Text or Caret as a text editor. (Text stores files in Google Docs and Caret stores the files locally on your machine, which may help you choose.) After that, you're good to go, since Chromebooks come with a browser installed.

Optio

@ladislavsulc
ladislavsulc / example.html
Last active July 11, 2017 00:47
Responsive images - Wordpress (Timber)
<img
src="{{ post.thumbnail.src|resize(480) }}"
srcset="
{{ post.thumbnail.src|resize(480) }} 480w,
{{ post.thumbnail.src|resize(220) }} 220w
"
sizes="
(min-width: 980px) 25vw,
50vw
"
@ladislavsulc
ladislavsulc / remove-empty-p.php
Created April 24, 2017 22:48 — forked from ninnypants/remove-empty-p.php
Remove empty p tags from WordPress posts
<?php
add_filter( 'the_content', 'remove_empty_p', 20, 1 );
function remove_empty_p( $content ){
// clean up p tags around block elements
$content = preg_replace( array(
'#<p>\s*<(div|aside|section|article|header|footer)#',
'#</(div|aside|section|article|header|footer)>\s*</p>#',
'#</(div|aside|section|article|header|footer)>\s*<br ?/?>#',
'#<(div|aside|section|article|header|footer)(.*?)>\s*</p>#',
'#<p>\s*</(div|aside|section|article|header|footer)#',
@ladislavsulc
ladislavsulc / .htaccess
Created July 29, 2017 20:00
Wordpress SEO Permanent Redirection (301)
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !.*domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f