Skip to content

Instantly share code, notes, and snippets.

@StyxOfDynamite
StyxOfDynamite / phpunit.xml
Created December 2, 2021 09:46
Basic PHP unit config
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="ItemCollectionTest">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
@StyxOfDynamite
StyxOfDynamite / StaticValetDriver.php
Last active June 9, 2020 15:31
Valet Driver - Serve Public Directory Files as Static Content
<?php
class StaticValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@StyxOfDynamite
StyxOfDynamite / default.htm
Created December 21, 2018 13:08
pagination - twig
<!-- page 1 -->
{% if posts.currentPage == 1 %}
{% for page in posts.currentPage .. posts.currentPage + 3 %}
<li class="{{ posts.currentPage == page ? 'active' : null }}">
<a href="{{ this.page.baseFileName|page({ (pageParam): page }) }}">{{ page }}</a>
</li>
{% endfor %}
{% endif %}
<!-- page 2 -->
....'.....'..
. .,clloddxxkkdclOKXXNNNNNNNXKd, .'
.c,. ,d0WWWMMMMMMMMMMMMWWMMWMMMMMMMMNk; ;d'
:OOd' ,xNMMMWMMMMMMMMMMMMMMMWMMMMMMMMMMMMNd. . .cOX:
,0MKx; ,' :KWMMMMWMMMMMMMMMMXx0MMWWMMMMMMMMMMMMWO,:: .;xXWWl
.kMWNOl' cOcoNMMMMMMMMMMWWMMWN
@StyxOfDynamite
StyxOfDynamite / 1_README.md
Created November 16, 2017 10:10 — forked from Daniel15/1_README.md
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/

@StyxOfDynamite
StyxOfDynamite / db.php
Created November 1, 2017 10:50
Magento 2 - MacOS Local Setup with Valet
<?php
// Put this file in your ~/.valet/Extensions directory!
/**
* Create a new database on your local machine.
*/
$app->command('db [name]', function ($name) {
if (! $name) {
warning('Please specify a database name');
@StyxOfDynamite
StyxOfDynamite / ready.js
Created October 16, 2017 19:53 — forked from olemak/ready.js
`JavaScript (ES2015) native "on document ready"
(() => { function fn() {
// "On document ready" commands:
console.log(document.readyState);
};
if (document.readyState != 'loading') {fn()}
else {document.addEventListener('DOMContentLoaded', fn)}
})();
Aberdeen
Armagh
Bangor
Bath
Belfast
Birmingham
Bradford
Brighton and Hove
Bristol
Cambridge
@StyxOfDynamite
StyxOfDynamite / broken.php
Last active May 8, 2017 14:18
Testing Profanity Filter.
<?php
class ProfanityTest extends TestCase {
protected $filter;
public function setUp()
{
$this->filter = new ProfanityFilter();
}
New York, NY
Los Angeles, CA
Chicago, IL
Brooklyn, NY
Queens, NY
Houston, TX
Manhattan, NY
Philadelphia, PA
Phoenix, AZ
San Antonio, TX