Skip to content

Instantly share code, notes, and snippets.

View yllus's full-sized avatar

Sully Syed yllus

View GitHub Profile
@yllus
yllus / GA_SEGMENT_IDS.md
Created August 29, 2018 18:02
Google Analytics built-in segment IDs
@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 / 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 / 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 / admin-ajax.php
Last active December 4, 2023 11:21
An optimized admin-ajax.php that executes visitor-only AJAX requests in WordPress
<?php
// Note: This file exists as a near-copy of /wp-admin/admin-ajax.php so that caching on this URL can occur.
/**
* WordPress AJAX Process Execution.
*
* @package WordPress
* @subpackage Administration
*
* @link https://codex.wordpress.org/AJAX_in_Plugins

The request I make is:

{
   "Version":2,
   "Type":"Program",
   "DateRanges":[
      {
         "StartDate":"2017-05-23T00:00:00Z",
 "EndDate":"2017-06-23T00:00:00Z"
@yllus
yllus / CFL_Fantasy_GA_code.html
Last active May 4, 2017 17:57
CFL Fantasy: Tracking code for Tracking ID UA-9442661-30
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-9442661-30', 'auto');
ga('send', 'pageview');
</script>
@yllus
yllus / TWEETS.txt
Last active November 21, 2016 18:37
Twitter Wall Tweets
#GoodLuckStamps
---------------
@mileyfan201 @calstampeders #goodluckstamps lets bring the greycup back to alberta where it belongs cheering from yql
@theolympicoval #JPPenguin says congrats to @bolevimitchell &amp; the @calstampeders on your big win in the @cfl West Final!
@1robinstweet 40+ years a Stamps fan. #GoodLuckStamps
@Redromeo9 @calstampeders We will be in the stands in TO screaming our support during the GC. GO STAMPS GO. 1 more win for Mylan. #GoodLuckStamps
@EmilyChristen12 Cheering on my team yesterday! @calstampeders what was the final attendance #? It looked full! #GoodLuckStamps #CFL
@auboo24 @CFL Bring home the Grey Cup for Mylan ️🏼 #GoodLuckStamps #Horsepower
@richard_gorham #goodluckstamps all the way from the UK. It's time for another #GreyCup JUST ONE MORE WIN BOYS - YOU CAN DO IT! #WhateverItTakes
SET NOCOUNT ON
SET XACT_ABORT ON
DECLARE @GameID INTEGER
SET @GameID = '2291'
DECLARE @ScoreAt TABLE (PlayID int PRIMARY KEY, HomeScore int, VisitorScore int)
INSERT INTO @ScoreAt (PlayID, HomeScore, VisitorScore)
SELECT p.PlayID, ISNULL(MAX(sp.HomeScore), 0) AS HomeScore, ISNULL(MAX(VisitorScore), 0) AS VisitorScore
@yllus
yllus / aws-copy-2016.bat
Last active October 16, 2016 20:33
aws-copy-2016.bat
aws s3 cp "\\dvs_CFL_server.corp.cfl.ca\fs1\DVSMEDIA\2016 CFL GAMES\16 GAME 75 OTT @ HAM\1675 10-14-16 OTT TV @ HAM TV.MP4" s3://cfl.vod.source/2016/2341.mp4
aws s3 cp "\\dvs_CFL_server.corp.cfl.ca\fs1\DVSMEDIA\2016 CFL GAMES\16 GAME 76 WPG @ BC\1676 10-14-16 WPG TV @ BC TV.MP4" s3://cfl.vod.source/2016/2342.mp4
aws s3 cp "\\dvs_CFL_server.corp.cfl.ca\fs1\DVSMEDIA\2016 CFL GAMES\16 GAME 77 SSK @ TOR\1677 10-15-16 SSK TV @ TOR TV.MP4" s3://cfl.vod.source/2016/2343.mp4
aws s3 cp "\\dvs_CFL_server.corp.cfl.ca\fs1\DVSMEDIA\2016 CFL GAMES\16 GAME 78 MTL @ CGY\1678 10-15-16 MTL TV @ CAL TV.MP4" s3://cfl.vod.source/2016/2344.mp4