Skip to content

Instantly share code, notes, and snippets.

View philcook's full-sized avatar
🌶️

Phil Cook philcook

🌶️
View GitHub Profile
@philcook
philcook / youtube-audio-only.html
Last active January 30, 2023 19:39
Youtube audio only player
<!DOCTYPE html>
<div style="display:flex;justify-content:center;align-items:center;">
<div style="width:400px;height:300px;">
<div data-video="I_2D8Eo15wE" data-autoplay="0" data-loop="1" id="youtube-audio"></div>
<div style="clear:both;margin:10px;text-align:center">
</div>
</div>
</div>
@philcook
philcook / roll.php
Created March 12, 2018 11:52
Percentage chance based on a roll of rand()
$roll = rand(0,99);
$percentage_chance = 10;
// Override based on IP for testing
if (in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1'))) {
$percentage_chance = 100;
}
if ($roll < $percentage_chance) {
echo 'Within 10% roll chance';
@philcook
philcook / interim pm process
Created January 6, 2017 14:19
Interim PM Processes
## Interim PM Process
- Alan to write up high level user story's for the clients requirements.
- Al to met with Zoe (PM) to discuss the user stories and Zoe Gnatt chart and make specification with task allocation (populate trello).
- **If designing process only**
Alan and Zoe (PM) then to meet with Matt to pass over user story's. Matt to start his design process(**TBC** - making wireframes, design).
- **Else if design and build process**
@philcook
philcook / gist:15bd50aeb8f80315d2bcaa9720c45bbb
Created September 1, 2016 13:54
For creating conditional based logic for page or any children pages that are under a parent page.
function if_page_or_ancestor_page_is($page_slug = NULL)
{
$is_page = false;
if (is_page()) {
global $post;
/* Get an array of Ancestors and Parents if they exist */
$parents = get_post_ancestors($post->ID);
$all_pages = array_reverse(array_merge($parents, array($post->ID)));