Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App;
class Player
{
/**
* @var string
*/
public string $name;
@laracasts
laracasts / StringCalculator.php
Created January 8, 2020 21:20
String Calculator Kata
<?php
namespace App;
use Exception;
class StringCalculator
{
/**
* The maximum number allowed.
@laracasts
laracasts / Game.php
Created January 3, 2020 16:10
Bowling Game Kata
<?php
namespace App;
class Game
{
/**
* The number of frames in a game.
*/
const FRAMES_PER_GAME = 10;
@laracasts
laracasts / RomanNumerals.php
Created December 15, 2019 18:47
Roman numerals Kata
<?php
namespace App;
class RomanNumerals
{
const NUMERALS = [
'M' => 1000,
'CM' => 900,
'D' => 500,
@laracasts
laracasts / modal.blade.php
Last active January 28, 2022 00:13
Modals with Zero JavaScript
<div id="{{ $name }}" class="overlay">
<a href="#" class="cancel"></a>
<div class="modal">
{{ $slot }}
<a href="#" class="close">&times;</a>
</div>
</div>
@laracasts
laracasts / Accordion.vue
Created May 25, 2018 20:39
vuecasts.com - episode 41 source code.
<template>
<div>
<accordion-item
v-for="(item, index) in items"
:title="item[titleName]"
:body="item[bodyName]"
:key="index"
:is-open="activeItemIndex == index"
@toggled="onToggle"
></accordion-item>
@laracasts
laracasts / vue-custom-input-component-exercise.js
Created January 9, 2017 18:16
vuecasts.com - Custom Input Components exercise.
Vue.component('coupon', {
props: ['code'],
template: `
<input type="text"
:value="code"
@input="updateCode($event.target.value)"
ref="input">
`,
let webpack = require('webpack');
let path = require('path');
module.exports = {
entry: {
app: './resources/assets/js/app.js',
vendor: ['vue', 'axios']
},
output: {
@laracasts
laracasts / Alert.vue
Created March 15, 2016 02:36
Alert .vue example.
<template>
<div class="Alert Alert--{{ type | capitalize }}">
<slot></slot>
</div>
</template>
<script>
export default {
props: {
type: {
{
"additional_path_items":
[
"/usr/local/php5/bin/"
],
"auto_complete_selector": "source, text",
"bold_folder_labels": true,
"color_scheme": "Packages/Colorsublime-Themes/Facebook.tmTheme",
"font_face": "Fira Code",
"font_options": [],