/**
* Validate some data.
*
* @param string|array $fields
* @param string|array $rules
* @return bool
*/
function validate($fields, $rules)
{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Define the servers | |
*/ | |
server('production-web', '<your server url>') | |
->path('<path to the project on your server>') | |
->user('<user on the server>') | |
->pubKey(); | |
/* |
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-mysql
sudo apt-get install php-memcached
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @return \App\User|null | |
*/ | |
function currentUser() | |
{ | |
return request()->user(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function undot(array $dottedArray) | |
{ | |
$undottedArray = []; | |
foreach ($dottedArray as $key => $value) { | |
Arr::set($undottedArray, $key, $value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function curry($f, $argument) | |
{ | |
return function (...$arguments) use ($f, $argument) { | |
return $f(...array_merge([$argument], $arguments)); | |
}; | |
} | |
function add(...$numbers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@setup | |
require __DIR__.'/vendor/autoload.php'; | |
(new \Dotenv\Dotenv(__DIR__, '.env'))->load(); | |
$appName = "my-app.com"; | |
$repository = "spatie/{$appName}"; | |
$baseDir = "/home/forge/{$appName}"; | |
$releasesDir = "{$baseDir}/releases"; | |
$currentDir = "{$baseDir}/current"; | |
$newReleaseName = date('Ymd-His'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<scheme name="GitHub" version="142" parent_scheme="Default"> | |
<option name="FONT_SCALE" value="1.0" /> | |
<metaInfo> | |
<property name="created">2018-05-07T11:01:49</property> | |
<property name="ide">PhpStorm</property> | |
<property name="ideVersion">2018.1.0.0</property> | |
<property name="modified">2018-05-07T11:02:04</property> | |
<property name="originalScheme">GitHub</property> | |
</metaInfo> | |
<option name="LINE_SPACING" value="1.4" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Check | |
{ | |
public function needsToRun(): bool | |
{ | |
if (!$this->belongsToTeamOnActiveSubscriptionOrOnGenericTrial()) { | |
return false; | |
} |
OlderNewer