This was inspired by the concise works of jeff's Skinner Box
Primary Article to begin with:
Lets make sure that we have all the sheilds up!
<?php | |
namespace App; | |
use Vinkla\Hashids\HashidsManager; | |
/** | |
* Bind a model to a route based on the hash of | |
* its id (or other specified key). | |
* |
This was inspired by the concise works of jeff's Skinner Box
Primary Article to begin with:
Lets make sure that we have all the sheilds up!
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>Subscriptions - [email protected]</title> | |
</head> | |
<body> | |
<outline text="PHP" title="PHP"> | |
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/> | |
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/> | |
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/> |
# Deployment with zero downtime | |
# By default keeps 2 last deployments in KEEP_DEPLOYMENTS_DIR and current deployment | |
# Project domain | |
PROJECT_NAME=test.com | |
# Project directory | |
PROJECT_DIR=/home/forge/test.com | |
# Deployments directory | |
KEEP_DEPLOYMENTS_DIR=/home/forge/deploy |
* 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.
# Only works on named components | |
# Vue.use( require('src/plugins/trace') ) | |
# npm install -g coffee-script | |
# coffee -bc trace.coffee | |
css = (color = 'black') -> " | |
background: #{color}; | |
font-weight: bold; | |
color: white; |
var currencyValidator = { | |
format: function (number) { | |
return (Math.trunc(number * 1000000000000) / 1000000000000).toFixed(2) | |
}, | |
parse: function (newString, oldNumber) { | |
var CleanParse = function (value) { | |
return { value: value } | |
} | |
var CurrencyWarning = function (warning, value) { | |
return { |
/*<?php | |
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
//\u000A\u002F\u002A | |
class PhpJava { | |
static function main() { | |
echo(//\u000A\u002A\u002F | |
"Hello World!"); | |
}} | |
//\u000A\u002F\u002A | |
PhpJava::main(); |
Modify: composer.json to use php 5.6.4 and laravel 5.3.*
Modify: config/app.php
Illuminate\Notifications\NotificationServiceProvider::class,
,'Notification' => Illuminate\Support\Facades\Notification::class,
Modify: app/Http/Kernel.php
'can' => \Illuminate\Auth\Middleware\Authorize::class,
From: http://dev.mysql.com/doc/refman/5.7/en/bit-functions.html#c9386
Posted by Neil Davis on April 3, 2008
Revised by Phillip Temple on September 11, 2008
If you store your ip addresses as a 32 bit unsigned integer representation instead of strings(using INET_ATON()), you can use bitwise operators to pull the octets for grouping and sorting when you need to retrieve them:
select
ipAddress, (ipAddress >> 24) as firstOctet,