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 | |
// Blogpost: XXX | |
// Assumes you have created a new column on your `media` table called `converted` (boolean default false) | |
// app/Console/Commands/UpgradeMediaCommand.php | |
namespace App\Console\Commands; | |
use App\Jobs\UpgradeS3MediaJob; |
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
const mix = require('laravel-mix'); | |
const tailwindcss = require('tailwindcss'); | |
require('laravel-mix-purgecss'); | |
mix | |
.js('resources/js/admin/admin.js', 'public/js') | |
.js('resources/js/front/front.js', 'public/js') | |
// Admin | |
.sass( |
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
name: CI | |
on: [push] | |
jobs: | |
tests: | |
name: Run PHP tests | |
runs-on: ubuntu-latest | |
steps: |
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 | |
/* | |
* We want to implement a logger | |
* | |
* We can have several loggers: 'bugsnag', 'sentry', 'file', 'database', 'redis' | |
* | |
* We want to be able to store which logger we use in our .env file | |
* | |
* Your job: |
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 DoesAwesomeStuff { | |
protected $meta = []; | |
protected $metaExtractor; | |
public function __construct($metaExtractor) | |
{ | |
$this->metaExtractor = $metaExtractor; | |
} |
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 SomeService | |
{ | |
public function callApi() | |
{ | |
$apiClass = new ApiClass; | |
$result = $apiClass->call('fetch'); | |
// Handle result |
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
<!doctype html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="Content-language" content="sv"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>Webbshop från Adaptive Shop</title> | |
<meta http-equiv="refresh" content="30"> | |
<meta name="robots" content="noindex"> | |
<style> | |
body { |
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
#!/bin/bash | |
#1. Add ssh key (stage key) to PROD machine | |
# 1.1 On stage: | |
# cat ~/.ssh/id_rsa.pub | |
# 1.2 On prod | |
# nano ~/.ssh/authorized_keys | |
# * paste key* | |
DATE=$(date +"%Y-%m-%d") |
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
#!/bin/sh | |
function allTestsShouldPass(){ | |
echo "Running tests..." | |
vendor/bin/phpunit | |
if [ $? -ne 0 ]; then | |
echo " -> ERROR. Tests did not pass, fix them!" | |
exit 1 | |
fi | |
} |
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 CodeigniterValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
NewerOlder