Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| # Apache configuration file | |
| # http://httpd.apache.org/docs/2.2/mod/quickreference.html | |
| # Note: ".htaccess" files are an overhead for each request. This logic should | |
| # be placed in your Apache config whenever possible. | |
| # http://httpd.apache.org/docs/2.2/howto/htaccess.html | |
| # Turning on the rewrite engine is necessary for the following rules and | |
| # features. "+FollowSymLinks" must be enabled for this to work symbolically. |
| <?php | |
| /** | |
| * A helper file for Laravel 5, to provide autocomplete information to your IDE | |
| * Generated for Laravel 5.5.13 on 2017-09-28. | |
| * | |
| * @author Barry vd. Heuvel <[email protected]> | |
| * @see https://github.com/barryvdh/laravel-ide-helper | |
| */ | |
| namespace { | |
| exit("This file should not be included, only analyzed by your IDE"); |
| server { | |
| listen 80; | |
| root /var/www/craft.dev/public; | |
| index index.php index.html index.htm; | |
| server_name craft.dev; | |
| location / { | |
| try_files $uri $uri/ @rewrites; |
Sentry is an amazing auth system. But I really need a feature: multiple user types in the same app. And I cannot separate those in groups, because they have different table columns. After 2 days burning my head, I think I found a good solution. The magic is duplicate SentryServiceProvider with new different settings.
Lets suppose we have a fresh Sentry install with default User ambient. Now we want another ambient called Admin, with new model and different settings. How to do:
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
| <IfModule mod_rewrite.c> | |
| Options +FollowSymLinks | |
| Options -MultiViews | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteRule ^ index.php [L] | |
| </IfModule> |
I was asked how I deal with validation / create and update validation rulesets. Well here is one method I have used. Don't be afraid to build on top of what the framework has already given you. In my projects I use a base class for almost anything. You never know when you want your classes to inherit some common functionality. My BaseValidator actually has some pretty useful methods and properties in it.
<?php
namespace FooProject\Internal\Validators;
use FooProject\Internal\Sanitizers\BaseSanitizer;| // Usage: | |
| // get_id_by_slug('any-page-slug'); | |
| function get_id_by_slug($page_slug) { | |
| $page = get_page_by_path($page_slug); | |
| if ($page) { | |
| return $page->ID; | |
| } else { | |
| return null; | |
| } |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |