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 | |
$roman = ['i' => 1, 'v' => 5, 'x' => 10, 'l' => 50, 'c' => 100, 'd' => 500, 'm' => 1000]; | |
$value = 'IX'; | |
$result = 0; | |
$prevValue = 0; | |
if (preg_match('/[^ivxlcdm]|i{4,}|x{4,}|c{4,}|m{4,}|v{2,}|l{2,}|d{2,}/i', $value)) { | |
return "invalid format"; |
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 | |
namespace Database\Seeders; | |
use Illuminate\Database\Seeder; | |
use Illuminate\Support\Facades\DB; | |
class SequentialIncrementNullColumns extends Seeder | |
{ | |
public function run(): void |
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 form = <TFormData>(formData: TFormData) => { | |
const $originalData = useCloneDeep(formData) as object; | |
const $errors = ref({}); | |
const $busy = ref(false); | |
let _data = formData as object; | |
const $setErrors = <TErrors>(errors: object | TErrors) => { | |
return ($errors.value = errors || {}); | |
}; |
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 | |
$string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed turpis adipiscing sodales ipsum sem ac. Orci sem nisl rutrum sagittis sed id. In tellus mauris tempor in at. Lorem ac sit tortor, eu sit elementum vestibulum ultrices egestas. In nunc, aliquet nulla quis. Tristique molestie integer ac ullamcorper dolor. Donec id erat turpis lobortis et egestas phasellus. Sit elit suspendisse porttitor egestas. Augue id mollis enim, eget sapien, luctus. Tortor, malesuada morbi et dui pretium adipiscing dui id rhoncus. Vitae et eget luctus ut nec donec. Vulputate pharetra tempus, congue eu commodo praesent imperdiet sapien. Vitae eleifend lobortis tellus enim, aliquam fermentum at venenatis. Mattis fringilla id viverra in metus pharetra, rutrum eget porta."; | |
$limit = 30; | |
$lines = []; | |
$collected = collect([]); | |
$words = explode(" ", $string); |
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 | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\Facades\DB; | |
class AddNaturalSortFunction extends Migration | |
{ | |
/** |
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
<script> | |
import { has, map } from 'lodash' | |
export default { | |
name: 'AftIcon', | |
functional: true, | |
props: { | |
tag: { |
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 plugin = require('tailwindcss/plugin') | |
/** | |
* Utlizes tailwind colors config and icon-{color} class is created, analog to bg- and text- classes. | |
* | |
* eg. class="icon-white" | |
*/ | |
const generateColors = (e, colors, prefix) => | |
Object.keys(colors).reduce((acc, key) => { | |
if (typeof colors[key] === 'string') { |