Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Markus Schober maxxscho

🏠
Working from home
Block or report user

Report or block maxxscho

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5847465ddf85f72d5ad0

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

@maxxscho
maxxscho / functions.php
Created Mar 17, 2012
Wordpress: Shortcode Empty Paragraph fix
View functions.php
function shortcode_empty_paragraph_fix($content)
{
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
$content = strtr($content, $array);
@maxxscho
maxxscho / custom_post_type_slider_image.php
Created Mar 7, 2012
Wordpress: Custom Post Type Template
View custom_post_type_slider_image.php
<?php
/* !-------- CUSTOM POST TYPE ------------------- */
/*------------------------------------------------------------ */
/**
* This is a Template for a Custom Post Type, in this case a Slider Image Post Type.
* I use this Post Type for Slideshows like Flexslider.
* Copy this file and/or customize it for you needs.
*/
@maxxscho
maxxscho / style.css
Created Apr 19, 2012
Wordpress Default CSS Styles
View style.css
/* !-------- WORDPRESS CLASSES ------------------- */
/*------------------------------------------------------------ *\
\*------------------------------------------------------------ */
/* !-- WP WYSIWYG Editor Styles -- */
.entry-content img {
margin: 0 0 1.5em 0;
}
.alignleft, img.alignleft {
margin-right: 1.5em;
@maxxscho
maxxscho / additional-methods.js
Created Aug 24, 2012
RegEx for decimal numbers with 'commas' or 'dots'
View additional-methods.js
/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:(\.|,)\d+)?$/
@maxxscho
maxxscho / homestead-base-setup.md
Last active Sep 4, 2017
Homestead Base Setup
View homestead-base-setup.md

Timezone

  1. Check your current timezone with date in the command line. You should get something like this. Fri Oct 3 10.32:13 UTC 2014 where UTC is your current timezone.
  2. To change your timezone just run sudo dpkg-reconfigure tzdata and follow the instructions. Easy!
  3. Check the timezone again with date. Now your timezone should be in this example CEST

Locale

Homestead provides an Ubuntu System and has by default only english locales installed. In PHP locales are important if you work for example with strftime. Check the currently installed locales with locale -a. To add a new locale, you have to generate it. For example for a german locale enter sudo locale-gen de_DE.UTF-8

@maxxscho
maxxscho / _strip-unit.scss
Created Aug 31, 2017
Strips the unit of a value in SCSS
View _strip-unit.scss
/// Remove the unit of a length
/// @param {Number} $number - Number to remove unit from
/// @return {Number} - Unitless number
@function strip-unit($number) {
@if type-of($number) == 'number' and not unitless($number) {
@return $number / ($number * 0 + 1);
}
@return $number;
}
View jquery-jumplink-scroll-animation.js
@maxxscho
maxxscho / _placeholder.scss
Created Apr 22, 2016
Mixin for styling the placeholder attribute on form fields
View _placeholder.scss
// Usage
// @include placeholder {
// font-style:italic;
// color: white;
// font-weight:100;
// }
@mixin placeholder {
::-webkit-input-placeholder {@content}
:-moz-placeholder {@content}
@maxxscho
maxxscho / smooth-scroll.js
Last active Apr 6, 2016
Smooth Scrolling for Jumplinks
View smooth-scroll.js
$('a.jumplink[href^="#"]').on('click', function(event) {
event.preventDefault();
var $this = $(this),
target = $this.attr('href');
if (target && target !== "#") {
$('html, body').animate({
scrollTop: $(target).offset().top
}, 600);
You can’t perform that action at this time.