THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| ; OpenVim.ahk | |
| ; | |
| ; Author: Arthur Jaron | |
| ; EMail: hifreeo@gmail.com | |
| ; Overview: | |
| ; Explorer_GetSelection(): Helper function (found in the AHK-forums) | |
| ; OpenVim(): Core function | |
| ; Hotkeys: | |
| ; Win+Enter: Open current file in gVim session "GVIM" |
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.
Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.
Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.
That's the theory, let's get to the work.
| <?php | |
| /* | |
| Plugin Name: wp_filter functions | |
| Plugin URI: http://www.damiencarbery.com/2017/06/list-functions-attached-to-an-action/ | |
| Description: List functions attached to all actions and filters. DON'T DO IT! | |
| Author: Damien Carbery | |
| Version: 0.1 | |
| */ | |
| add_action( 'wp_head', 'wp_filter_the_wrong_way' ); |
TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.
If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)
A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/
The reason to avoid JWTs comes down to a couple different points:
| scriptencoding utf-8 " basic | |
| set nocompatible " basic | |
| filetype off " basic | |
| filetype plugin on " Enable filetype plugins | |
| filetype indent on " Enable loading the indent file for specific file types | |
| syntax enable " Enable syntax highlighting | |
| set encoding=utf-8 " Encoding (needed in youcompleteme) | |
| set fileencoding=utf-8 " The encoding written to file. | |
| set noerrorbells " No annoying sound on errors | |
| set number " Line numbers on |
| # ============================================================================ | |
| # NOTES | |
| # ============================================================================ | |
| # Show help: prefix + ? | |
| # ============================================================================ | |
| # CONFIG MANAGEMENT | |
| # ============================================================================ |
| // I'm tired of extensions that automatically: | |
| // - show welcome pages / walkthroughs | |
| // - show release notes | |
| // - send telemetry | |
| // - recommend things | |
| // | |
| // This disables all of that stuff. | |
| // If you have more config, leave a comment so I can add it!! | |
| { |