Many of the more "advanced" typescript features can be used for creating "value-derived" types.
At its simplest form:
let vehicle = { name: "Van", wheels: 4 }| const Webpackbar = require('webpackbar') | |
| module.exports = { | |
| webpack: (config, { isServer }) => { | |
| config.plugins.push(new Webpackbar({ name: isServer ? 'server' : 'client' })) | |
| return config | |
| } | |
| } |
| <div x-data="{ bankAccounts: [{ | |
| id: '', | |
| accountNumber: '' | |
| }] }"> | |
| <template x-for="(bankAccount, index, bankAccounts) in bankAccounts" :key="index"> | |
| <div class="grid grid-cols-6 gap-6 mt-2"> | |
| <div class="col-span-3 md:col-span-3 sm:col-span-2"> | |
| <x-jet-label for="city">Bank</x-jet-label> | |
| <select :name="`bank_info[${index}][bank_id]`" id="bank" | |
| class="border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm mt-1 block w-full"> |
| <?php | |
| use Illuminate\Database\Migrations\Migration; | |
| use Illuminate\Database\Schema\Blueprint; | |
| use Illuminate\Support\Facades\Schema; | |
| class MigrateToJetstream extends Migration | |
| { | |
| public function up() | |
| { |
| @props([ | |
| 'percentage' => 0, | |
| 'failed' => false | |
| ]) | |
| @php | |
| $done = $failed || $percentage == 100; | |
| @endphp | |
| <div {{ $attributes->merge(['class' => ' space-y-1'])->whereDoesntStartWith('wire:poll') }} |
| // Demo; https://codepen.io/KevinBatdorf/pen/RwGEdpr?editors=1011 | |
| // Load in before you load Alpine | |
| function AlpineAutoInitChildren() { | |
| // Use: <div x-data x-init="$initChildren()"> | |
| Alpine.addMagicProperty('initChildren', ($el) => { | |
| return () => { | |
| // Grab all child x-init. Customize if you want to only run based on a specific condition | |
| Array.from($el.querySelectorAll('[x-init]')).forEach(child => { | |
| # Install the latest wsl2 with systemd support | |
| # https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ | |
| # Update the latest wsl | |
| wsl --update --web-download | |
| # Install Ubuntu with username vagrant | |
| wsl --install -d Ubuntu-22.04 | |
| # Set Ubuntu as default distro |
| // Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e | |
| // by @levelsio | |
| // HOW TO | |
| // 1) Make a Google Sheet, we'll pull the first cell e.g. A1 | |
| // 2) Publish your Google Sheet, File -> Publish To Web | |
| // 3) Copy the SHEET_ID in the URL, put it in here below: | |
| const endpoint = "https://spreadsheets.google.com/feeds/cells/SHEET_ID/1/public/full?alt=json" | |
| // 4) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188 | |
| // 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc) |
| <?php | |
| trait Sortable | |
| { | |
| /** | |
| * This function receives a $newOrder array parameter, which contains the order in which | |
| * we should sort our items after being dragged in the UI. The format of the $newOrder is: | |
| * | |
| * [ | |
| * newIndex => [ |
Let's say there are two branches: master and feature-one.
There are some files that you want in the master branch from the feature-one branch but not all the files.
Let's say those files are:
app/Models/User.php
app/Controllers/UsersController.php
You can accomplish that by doing the following: