Skip to content

Instantly share code, notes, and snippets.

Avatar

Kasparas Galdikas kasparasg

View GitHub Profile
View BallClock.test.ts
import BallClock from './BallClock'
describe('BallClock Test', () => {
let ballClock
beforeEach(() => {
ballClock = new BallClock()
})
it('should throw error when input number of balls is not between 27 and 127', () => {
expect(() => ballClock.init(26)).toThrowError()
@kasparasg
kasparasg / Schedulable.php
Created Jun 25, 2018 — forked from davidpiesse/Schedulable.php
Laravel Custom Class/Model Scheduling
View Schedulable.php
<?php
//Don't forget to change the namespace!
namespace App\Traits;
use Cron\CronExpression;
use Illuminate\Support\Carbon;
use Illuminate\Console\Scheduling\ManagesFrequencies;
trait Schedulable{
View modelling.php
<?php
class League extends Model
{
public function teams()
{
return $this->hasMany(Team::class);
}
}