Skip to content

Instantly share code, notes, and snippets.

Avatar

Muah ctf0

View GitHub Profile
View laravel excel sheet formating.php
<?php
// thanx to https://i.stack.imgur.com/5llwN.png
// no we can auto handle all the cells in the sheet
// in one go
public function registerEvents(): array
{
return [
BeforeExport::class => function (BeforeExport $event) {
$writer = $event->writer;
View laravel auto resolve polymorphic many to many.md
View laravel multi guards.md

incase you want to use a different/separate provider to allow users to login into the app, with this everything in app logic remains the same while achieving exactly what we want

  • model
class Admin extends Authenticatable
{
    use Notifiable;

    protected $guarded = ['id'];
View _vscode custom styleing.md
  • add the files in that order
"vscode_custom_css.imports": [
    "file:///path/to/vars.css",
    "file:///path/to/defaults.css",
    "file:///path/to/theme-stuff.css",
    "file:///path/to/tabs-curve.css", // or normal
    "file:///path/to/tabs-single.css"
],
View -vscode tips.md
  • get current theme styles
// https://stackoverflow.com/questions/47117621/how-to-get-the-vscode-theme-color-in-vscode-extensions
const color = new vscode.ThemeColor('badge.background');
  • commands icons can use vscode builtin
"commands": [
    // ... ,
View array min items.md
  • langs/*/validation.php
<?php

['array_min_items' => 'at least :value :attribute is required'],
  • AppServiceProvider.php
<?php
View ScrollingLettersAnimation.js
/**
* demo1.js
* http://www.codrops.com
* https://github.com/codrops/ScrollingLettersAnimation
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2018, Codrops
* http://www.codrops.com
@ctf0
ctf0 / -laravel tips.md
Last active Jul 16, 2020
laravel tips
View -laravel tips.md
  • php assoc array to correct js array of objs
<?php

$data = [
    'Users' => 'abc',
    'posts' => 'blabla',
];
You can’t perform that action at this time.