Skip to content

Instantly share code, notes, and snippets.

View phptek's full-sized avatar

Russ Michell phptek

View GitHub Profile
@phptek
phptek / TUNEZ
Last active March 29, 2021 02:19
Susana Feat Espen Gulbrandsen: "Connection" (Myon & Shane 54 Monsterless Mix) http://www.di.fm/tracks/69386/vocaltrance
Karel: "Transit" http://www.di.fm/tracks/698255/classictrance
Pulser Feat Molly Bankcroft: "In Deep" http://www.di.fm/tracks/56820/vocaltrance
Three Drives: "Greece 2000" (g&m remix) http://www.di.fm/tracks/75438/classictrance
Ferry Corsten feat. Guru: "Junk": http://www.di.fm/tracks/87356/trance
Gods Kitchen Summer Trance CD2: http://www.di.fm/tracks/91421/classictrance
Push: "Tranzy State Of Mind": http://www.di.fm/tracks/29727/classictrance
Cygnus X: "The Orange Theme": http://www.di.fm/tracks/67438/classictrance
Dave Angel "Balance Selections 007" (Soundcloud)
/**
* Generate an array of records on reverse class relationships set through a DataExtension.
* E.g. Some DataExtension provides its extended objects with a ManyMany component called 'Fooz'.
*
* On deletion of an extended record, if as we should, we can ensure we clean-up properly and
* remove the relation to the deleted record in the join table.
*
* @param string $manyManyComponentName
* @return array
*/
@phptek
phptek / gist:c03e2530bdd8b491988b
Created December 16, 2015 23:56
EditorConfig
# Deviate Ltd EditorConfig file
#
# Place this file at the root of your project customisations and rename it: .editorconfig
#
# See: https://en.wikipedia.org/wiki/Newline
# See: http://editorconfig.org/
#
[*.php]
charset = utf-8
How to configure phpStorm with EditorConfig and PHPMD:
-----------------------------------------------------
PHPMD:
------
phpmd (PHP Mess Detector) is a static analysis tool that will find issues in your code you never knew you had. Your code will still run, follow a few of phpmd's recommendations though and it will be better!
phpmd is already bundled and enabled in phpstorm, but in order to more easily manage versions and add custom rulesets, you should do the following:
Random notes from PHP Conf NZ 2015
* What core PHP functionality relies on SPL? (Core PHP5 interfaces for everyday use: http://php.net/manual/en/intro.spl.php)
* Take another look at Generators (Reduced memory footprint vs std iteration: http://php.net/manual/en/language.generators.overview.php)
* Look at File();
* Look at Pthreads proper multithreading
* What are co-routines again?
* ZTS Zend Thread Safety
* Performance:
- Measure TTFB
# PHPStorm Issues
## Environment
Ubuntu 14.04 / phpStorm 9.0.2 / OpenJDK 1.7.0_79 / Acer Aspire TimelineX
## Bugs
The IDE occassionally stalls such that I can no longer edit, or make any changes whatsoever to any
tabs that remain open. Neither can I move the caret around using up/down keys. If I switch to another project (in the same window) I cannot
/**
*
* Determines if the current page has any translations.
*
* "Translation" means:
*
* >=1 of a page's translated fields e.g. `Title_ar_EG` is populated, And/Or
* >=1 of a page's `has|many_xxx` related classes, itself has >=1 translated + populated field(s), And/Or
* >=1 of a page's arbitrary ORM calls to a DataObject sub-class, itself has >=1 translated & populated field(s)
*
/**
*
* In order to tell whether any Fluent-enabled (FLuent augmented) ORM queries
* exist on the current object and whether or not they have data, we need to
* hook into all ORM queries made on each page. The result of which can be cached
* somewhere and consumed accordingly.
*
* Note: Doesn't augment anything. We're using augmentSQL() as an "entry-point".
*
* @param SQLQuery $query
/**
*
* Alternative and (will be) much faster menu generator to {@link ContentController::getMenu()}.
*
* - Uses raw DataQuery, skipping most of the ORM's heavy lifting
* - Doesn't require repeated calls to {@link Hierarchy::Children()}
* - Still works with unmodified template logic that calls $Menu(1).
SEE: Hierarchy::loadDescendantIDListInto()
*
* @param int $level Menu level to return.
@phptek
phptek / DIFMURLS
Created April 23, 2015 22:30
di.fm
http://listen.di.fm/public3/trance.pls
http://listen.di.fm/public3/vocaltrance.pls