Skip to content

Instantly share code, notes, and snippets.

View yllus's full-sized avatar

Sully Syed yllus

View GitHub Profile
@yllus
yllus / gist:f933f83303f689a13d90
Last active August 29, 2015 14:19
Only display the loyalty mobile warning once every 2 days (setting a cookie)
<!-- Loyalty mobile warning -->
<script>
$(document).ready(function() {
var isMobile = window.matchMedia("only screen and (max-width: 760px)");
var isCookieSet = getCookie('loyalty_mobile_warning');
if (isMobile.matches && isCookieSet === false) {
setCookie('loyalty_mobile_warning', '1', 2);
alert("The 680 NEWS Insider Club is optimized to work best on a computer or tablet. Please log in using one of those devices. If you are on a smartphone, rotate it to landscape mode.")
}
});
<?php if ( is_home() ): ?>
<div id="ad_sliver" class="sliver">
<script> adUtility.insertAd("ad_sliver", { type: adUtility._AD_SLIVER }); </script>
</div>
<?php else: ?>
<div id="ad_sliver" class="sliver">
<script>if ( window.snBreakpointWatcher.breakPoint() >= 1024 ) { adUtility.insertAd("ad_sliver", { type: adUtility._AD_SLIVER }); }</script>
</div>
<?php endif; ?>
<?php
define('FOLDER_CLEANUP', '/Users/rdmdev/Downloads/temp');
$files = scandir(FOLDER_CLEANUP);
foreach ($files as $file) {
$wanted = explode("_", $file);
if (strpos($files[array_search($file, $files) + 6], $wanted[1]))
{
//unlink(FOLDER_CLEANUP . "/" . $file);
echo "Deleting: " . FOLDER_CLEANUP . "/" . $file . "\n";
@yllus
yllus / Apple's iMac scrolling effect.markdown
Created July 6, 2015 18:24
Apple's iMac scrolling effect
@yllus
yllus / gist:0c944d1803f7c25cdfde
Created August 7, 2015 00:39
Macleans.ca debate in other media
Huffington Post Canada bingo Facebook post:
<div id="fb-root"></div><script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><div class="fb-post" data-href="https://www.facebook.com/HuffPostCanada/posts/978107295542783:0" data-width="500"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/HuffPostCanada/posts/978107295542783:0"><p>Play along at home if you&#039;re watching tonight&#039;s Maclean&#039;s debate</p>Posted by <a href="https://www.facebook.com/HuffPostCanada">The Huffington Post Canada</a> on&nbsp;<a href="https://www.facebook.com/HuffPostCanada/posts/978107295542783:0">Thursday, August 6, 2015</a></blockquote></div></div>
Vox.com's explainer on the 2015 Canadian election:
http://www.vox.com/2015/8/6/9109669/2015-canada-fed
/**
* Check the responsiveness of a tcp/ip daemon
* @return (bool) true when $host:$post responds within $float_timeout seconds, else (bool) false
*/
function check_tcp_responsiveness( $host, $port, $float_timeout ) {
if ( function_exists( 'apc_store' ) ) {
$use_apc = true;
$apc_key = "{$host}{$port}";
$apc_ttl = 10;
} else {
@yllus
yllus / gist:c26d77287ee52e1d967b
Created October 16, 2015 18:11
Contract Job Details
DESCRIPTION:
It's an exciting, fast-changing time to be part of Rogers and the Canadian media industry. The national NHL deal for Sportsnet, the incredible depth of the Next Issue Canada brand, and the new Rogers 3.0 company plan just starting to lay roots are all contributing to taking the company to new heights.
Right now, we're currently looking for a senior, full-stack web developer to come join the technology team based in downtown Toronto. This person would enjoy work side by side with other developers, designers and product managers in a cross-functional team where product excellence is the only goal.
- Work within a small, cross-functional agile development team (5 - 7 people) to meet the needs of the client
- Listen to the oral and written requests of the client, and articulate to them suitable technical solutions for the request
- Implement solutions upon WordPress websites using PHP, jQuery, CSS and HTML
- Bring passion for the products you create, and a strong ability to communicate that pass
<?php
/**
* The template for displaying Comments, Green News Sites
*
* The area of the page that contains comments and the comment form.
*/
global $post;
global $current_user;
global $wp_query;
/*
@yllus
yllus / BC-PLAYER.html
Last active November 26, 2015 20:10
CFL.ca: Brightcove playlist player for the site sidebar
<!-- START: Brightcove playlist player -->
<div class="component" style="margin-top: 10px;">
<video id="bc_playlist_player"
data-playlist-id="4596397096001"
data-account="4401740954001"
data-player="default"
data-embed="default"
class="video-js" controls></video>
<script src="http://players.brightcove.net/4401740954001/default_default/index.min.js"></script>
<script src="http://players.brightcove.net/videojs-ima3/videojs.ima3.min.js"></script>

Hamilton Tiger-Cats Ad Units

300x250 "Big Box" Ad Unit

We've created an ad unit called "Ticats_BigBox" for use:

<script type='text/javascript'>
  googletag.cmd.push(function() {
    googletag.defineSlot('/103711331/Ticats_BigBox', [300, 250], 'div-gpt-ad-1449680940264-0').addService(googletag.pubads());

googletag.pubads().enableSingleRequest();