Skip to content

Instantly share code, notes, and snippets.

View yllus's full-sized avatar

Sully Syed yllus

View GitHub Profile
@yllus
yllus / build_pcntl.sh
Created April 24, 2018 19:08 — forked from jbanety/build_pcntl.sh
Build PCNTL ext for MAMP PHP 7.1.1
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl libjpeg libpng lzlib curl imap-uw readline postgresql libxml2 mcrypt gettext libxslt homebrew/dupes/libiconv icu4c expat bison webp freetype
# Dirs
mkdir -p /Applications/MAMP/bin/php/php7.1.1/include
cd /Applications/MAMP/bin/php/php7.1.1/include
@yllus
yllus / eltool.sh
Created May 9, 2018 13:59 — forked from dimkir/eltool.sh
Tool for building dependencies for electron on Amazon Linux (and maybe on CentOS / RHEL)
#!/bin/bash
DIST_DEPS=0
CENTOS_DEPS=0
GCONF_COMPILE=0
GCONF_INSTALL=0
PIXBUF_INSTALL=0
PIXBUF_COMPILE=0
@yllus
yllus / nightmare-on-amazon-linux.MD
Created May 9, 2018 15:21 — forked from dimkir/nightmare-on-amazon-linux.MD
How to run nightmare on Amazon Linux

Running nightmare on Amazon Linux

You may have thought of running nightmare on AWS Lambda. But before we can run it on Lambda, we need first to make it run on Amazon Linux.

Provision instance which replicates Lambda environment

According to AWS Documentation on Lambda Execution Environment and available Libraries we would need this AMI image with this alias amzn-ami-hvm-2016.03.3.x86_64-gp2. Keep in mind that AMI-image-id for this instance would be different in different regions (eg):

  • In eu-west-1 - ami-f9dd458a
  • In us-east-1 - ami-6869aa05
@yllus
yllus / GA_SEGMENT_IDS.md
Created August 29, 2018 18:02
Google Analytics built-in segment IDs
@yllus
yllus / cfl_adroll.js
Created May 10, 2019 14:26
CFL AdRoll Pixel JavaScript
<script type="text/javascript">
adroll_adv_id = "VCFLFD3OXNHUHFWE65TTX6";
adroll_pix_id = "4J6TAQVMYBHN5NUJU3YQOS";
(function () {
var _onload = function(){
if (document.readyState && !/loaded|complete/.test(document.readyState)){setTimeout(_onload, 10);return}
if (!window.__adroll_loaded){__adroll_loaded=true;setTimeout(_onload, 50);return}
var scr = document.createElement("script");
var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
<!-- START: Put this in the header of your page; if you already have another ad unit on the page this is probably a duplicate and unnecessary. -->
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<!-- END: Put this in the header of your page; if you already have another ad unit on the page this is probably a duplicate and unnecessary. -->
<!-- START: This is the actual ad unit, so place it where you want the leaderboard to appear. -->
<script>
<!-- START: Put this in the header of your page; if you already have another ad unit on the page this is probably a duplicate and unnecessary. -->
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<!-- END: Put this in the header of your page; if you already have another ad unit on the page this is probably a duplicate and unnecessary. -->
<!-- START: This is the actual ad unit, so place it where you want the big box ad to appear. -->
<script>
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {
googletag.defineSlot('/103711331/Ticats_BigBox', [300, 250], 'div-gpt-ad-1561482442188-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
// Took this JavaScript code from:
// https://ticats.ca/video/thomas-erlington-goes-75-yards-to-the-house
// Added some comments (look for COMMENT:) on what may need to be modified for the preroll ads to show successfully.
<script type="text/javascript">
function vastFromTags( tags, channels ) {
if ( tags ) {
var keywords = '&Tags=' + tags;
}
<?php
// Rules:
// 1) Get the top three teams by points from each division.
// 2) For each division, check to see if the 3rd place team in it has less points than the
// 4th place team of the other division (must have at least one point less, a tie means no crossover occurs).
// 2a) If it does, insert that 4th place team above the other division's 3rd place.
// 2b) Else leave the standings for that division as-is.
public static function get_crossover( $args ) {
// If the season request is < 2016, return an empty object.
@yllus
yllus / TRIALFIRE.js
Created February 7, 2020 22:49
Trialfire library for ticats.ca
<!-- Trialfire Start -->
<script src="//cdn.trialfire.com/tf.js"></script>
<script>Trialfire.init('d868f38b-0943-4ada-a0a7-560ca325a62b');</script>
<!-- Trialfire End -->