All posts by mewben

Force CSS changes to “go live” immediately

Mark on WordPress

If you update your WordPress theme’s style.css, you may have noticed that you have to “force-reload” your site in your browser to see the changes. This is because your browser keeps a copy of the CSS cached on your hard drive. Depending on how your server is set up, it may not check for a new version of the stylesheet for a couple hours, or longer! And even if you force-reload to see the changes, visitors who have previously accessed your site may still get the old CSS. One way to solve this is to “version” your CSS file, by adding ?v=123 to the URL in the <link /> to your stylesheet. This is rather a pain to have to do by hand every time, so here is a much better way:

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

This…

View original post 19 more words

Advertisements

23 Things Only People Who Love Spending Time Alone Will Understand

Thought Catalog

Sascha KohlmannSascha Kohlmann

1. A weekend in which you have no plans, no responsibilities, and nowhere at all to be, ranks as one of the best weekends you’ll ever have.

2. Sometimes friends will try to make plans with you and you have no reason to decline except for the fact that you just want to be alone that day. (Your plan is to have no plans, people need to understand that by now, right?)

3. A good album, book, or television show can keep your attention far longer than any party, club, or bar could.

4. Going away to a remote cabin in the middle of the woods to just exist for a period of time sounds like the best idea for a vacation that you can think of.

5. There is nothing more exciting than planning a long, solo road trip, because you know you’re going to be able…

View original post 601 more words

How To: CRUD with Validation in Ember.js Using ember-easyForm, ember-validations, and Boostrap

Nailed it.

Aloysius Lim

One of the basic building blocks of any web application is CRUD, or Create, Read, Update and Delete.It allows users and administrators to manage the data in the application. Full-stack server-side MVC frameworks like Django or Ruby on Rails provide code generators that give you all the code needed for a basic CRUD interface. But what if you were usingEmber.js to build your application? Ember.js does not provide any code generators, and there is no established idiom or best practices for CRUD in Ember.js. In this series I will show how to build a basic CRUD interface in Ember.js, complete with user input validation.

View original post 2,430 more words

Traits in PHP

Trait

Laravel Tutorials, Tips & Tricks

If you worked with abstract objects before, you are aware of the single inheritance limitation, traits fix this in a very elegant way to allow us to write re-usable code.

Creating traits

Traits are created using the trait keyword:

Using traits

To add a trait to a class, use the use keyword within the class:

That’s it! now you have all the trait’s methods available, to use multiple traits you can declare them on the same line separating them with a comma:

Note: traits can’t be instantiated.

View original post