Skip to content

Instantly share code, notes, and snippets.

View nathanpitman's full-sized avatar
💭
I may be slow to respond.

Nathan Pitman nathanpitman

💭
I may be slow to respond.
View GitHub Profile
// Returns true or false if flash installed or not. Tested with IE8 on Windows 7 and Chrome on Win7 and Mac.
(function() { var ie_flash; try { ie_flash = (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false) } catch(err) { ie_flash = false; } var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || ie_flash); return _flash_installed; })()
@nathanpitman
nathanpitman / switch.txt
Last active August 29, 2015 14:28
ExpressionEngine switch, always be closing
{exp:channel:entries}
{switch='<div class="row">||'}
<div class="col-md-4">
{sn_programme_block}
</div><!-- / .col-md-4 -->
{if count!=total_results}{switch='||</div><!-- / .row -->'}{/if}
@nathanpitman
nathanpitman / switch.txt
Last active August 29, 2015 14:28
ExpressionEngine switch, always be closing (Feature Request)
{exp:channel:entries}
{switch values='<div class="row">||'}
<div class="col-md-4">
{sn_programme_block}
</div><!-- / .col-md-4 -->
{switch values='||</div><!-- / .row -->' closing='</div><!-- / .row -->'}
@nathanpitman
nathanpitman / parse-hls-url.php
Created December 8, 2015 14:12
Used to parse Vimeo HLS URLs to negate issues with redirects and JW Player
/**
* Parse Vimeo M3U8 URLs to negate relative redirect issues with JW Player (See issue #1510)
*
* @return string
*/
public function parseHLSUrl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); //set url