Skip to content

Instantly share code, notes, and snippets.

View yllus's full-sized avatar

Sully Syed yllus

View GitHub Profile

The sponsor image can be retrieved at:

http://pubads.g.doubleclick.net/gampad/ad?iu=/103711331/CFL_Mobile_App_Week_Sponsor&sz=380x60&t=slot%3Dad-schedule-week-11&c=[correlator]

The link that should be navigated to if tapped:

http://pubads.g.doubleclick.net/gampad/jump?iu=/103711331/CFL_Mobile_App_Week_Sponsor&sz=380x60&t=slot%3Dad-schedule-week-11&c=[correlator]

A few quick notes:

We're using a modified version of the Brightcove Video Cloud WordPress plug-in to use a new post type in our WordPress site called Video (the post type tag is bc-video). Our workflow is pretty simple - we ask that our video production staff upload new video content into Brightcove at https://studio.brightcove.com/ , and set the video's title, description and tags (more on that in a minute) before marking the video as active.

Once a video is active, it's eligible for the PHP script we have running on one of our webservers to see and create a Video post in WordPress out of. We have a tiny Bash script called cron_brightcove.sh that simply contains these lines:

#!/bin/sh

cd /app/cflca/public/wp-content/plugins/brightcove-video-cloud/cmd/

@yllus
yllus / gist:ec39c145f0cf016c5057
Last active February 3, 2016 20:22 — forked from Bouke/gist:10454272
Install FreeTDS, unixODBC and pyodbc on OS X

First, install the following libraries:

$ brew install unixodbc
$ brew install freetds --with-unixodbc

FreeTDS should already work now, without configuration:

$ tsql -S [IP or hostname] -U [username] -P [password]
locale is "en_US.UTF-8"

locale charset is "UTF-8"

@yllus
yllus / brightcove-videojs-tasks.js
Created February 1, 2016 20:57
JavaScript code we load on all pages that use the new VideoJS-based Brightcove video player
var CFLVideo = window.CFLVideo || {};
CFLVideo.Brightcove = (function() {
var _this, _element, _players = [];
function displayAds( video_player_id ) {
var player = videojs( video_player_id );
// If ads are disabled for this video, exit immediately.
if ( typeof player.options().disableads !== 'undefined' ) {
if ( player.options().disableads == 'true' ) {
.site-title {
display: none;
}

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();

@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>
<?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 / 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
/**
* 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 {