Skip to content

Instantly share code, notes, and snippets.

View oliviagardiner's full-sized avatar
👾
pew pew

Olivia Gardiner oliviagardiner

👾
pew pew
View GitHub Profile
@oliviagardiner
oliviagardiner / BowlingGame.php
Last active October 3, 2023 20:30
[PHP] Bowling kata TDD
<?php declare(strict_types=1);
namespace App;
use App\Exception\GameOverException;
use App\Exception\InvalidFrameException;
use App\Exception\InvalidRollException;
/**
The initial class written to pass the unit tests
@oliviagardiner
oliviagardiner / arraywrapper-codepractice.php
Last active January 31, 2022 21:14
Correcting my own mistakes on a practice task
<?php
/**
Write a wrapper class that should encapsulate an array. Validate that the array only has integer elements. If not, raise an exception.
Implement a method that returns with numbers from the array that OCCURS odd number of times.
*/
// original
/*
@oliviagardiner
oliviagardiner / rfc3161.txt
Created June 16, 2020 08:01 — forked from Manouchehri/rfc3161.txt
List of free rfc3161 servers.
http://timestamp.globalsign.com/scripts/timstamp.dll
https://timestamp.geotrust.com/tsa
http://timestamp.comodoca.com/rfc3161
http://timestamp.wosign.com
http://tsa.startssl.com/rfc3161
http://time.certum.pl
http://timestamp.digicert.com
https://freetsa.org
http://dse200.ncipher.com/TSS/HttpTspServer
http://tsa.safecreative.org
@oliviagardiner
oliviagardiner / MyModelSearch.php
Last active May 19, 2020 10:22
How to sort & filter a Yii2 active query generated with findBySql()
<?php
/**
* If you try to pass a query generated with findBySql() to an ActiveDataProvider,
* you will find that the convenient filtering and sorting methods won't work on your query,
* because the SQL statement is already specified.
*
* See: https://www.yiiframework.com/doc/api/2.0/yii-db-activerecord#findBySql()-detail
*
* However, if you use an ArrayDataProvider instead of an ActiveDataProvider,
@oliviagardiner
oliviagardiner / nuxt-i18n-anchor-link.vue
Last active February 11, 2020 21:04
Use Nuxt i18n + anchor oneline solution
@oliviagardiner
oliviagardiner / component.vue
Last active February 1, 2021 01:03
Nuxt.js + vue-moment
// components/component.vue
<template lang="pug">
div {{ new Date() | moment("dddd, MMMM Do YYYY, h:mm:ss a") }}
b-form-select(:value="locale" @change="changeLocale($event)")
option(v-for="lang in locales" :value="lang" :key="lang")
i(:class="'flag-icon-' + lang").flag-icon
</template>
<script>