Skip to content

Instantly share code, notes, and snippets.

View ladislavsulc's full-sized avatar

Ladislav Šulc ladislavsulc

View GitHub Profile
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
$('.backtotop').click(function(e){
e.preventDefault();
$('html, body').animate({scrollTop:0}, 'slow');
});
@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 / 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 / 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)#',
# Install script for Kristoffer
# Created 06.08.2015
ECHO Installing apps
ECHO Configure chocolatey
choco feature enable -n allowGlobalConfirmation
#choco install visualstudiocode
choco install notepadplusplus
@ladislavsulc
ladislavsulc / install_steam
Created May 31, 2018 23:48 — forked from vespakoen/install_steam
install steam & age of empires 2 HD on ubuntu 14.04
# install wine 1.7
add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.7
# download steam
curl -o ~/Downloads/SteamSetup.exe http://media.steampowered.com/client/installer/SteamSetup.exe
# install some tricks
winetricks vcrun2010