Skip to content

Instantly share code, notes, and snippets.

View AramZS's full-sized avatar
🎯
Focusing

Aram Zucker-Scharff AramZS

🎯
Focusing
View GitHub Profile
@AramZS
AramZS / moatvideo.js
Created February 18, 2016 22:02
Moat Video
/*Copyright (c) 2011-2016 Moat Inc. All Rights Reserved.*/
try {
(function(x, t) {
var l = {},
X, ga, ha, ca = 0,
da = {},
Y = [],
D = {},
O = [],
(function() {
window.adaptvInfo = {
POSITION: {
ABOVE_VISIBLE_AREA: "aboveVisibleArea",
BELOW_VISIBLE_AREA: "belowVisibleArea",
LEFT_TO_VISIBLE_AREA: "leftToVisibleArea",
RIGHT_TO_VISIBLE_AREA: "rightToVisibleArea",
IN_VISIBLE_AREA: "inVisibleArea",
HIDDEN: "hidden",
@AramZS
AramZS / te_re.js
Created January 21, 2016 21:20
TruEffect Bullshit (you publish shitting minimized code in your ad unit, I'm putting it on the web)
///#source 1 1 /te_re/modules/te_re.START.js
/// <reference path="te_re.base.js" />
/// <reference path="te_re.browser.js" />
/*
TruEffect Rendering Engine
*/
if (te_re == undefined || te_re == null) {
///#source 1 1 /te_re/modules/te_re.base.js
/// <reference path="te_re.base.js" />
@AramZS
AramZS / pre-commit
Created January 21, 2016 01:30
Githook to assure file permissions (must be +x ed)
#!/usr/bin/php
<?php
echo "Start a git filecheck \n";
$output = array();
$return = 0;
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return);
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
exec("git diff-index --cached --name-only {$against}", $output);
@AramZS
AramZS / Author_leaderboard.php
Last active September 5, 2015 17:25
Test functions based on PF stats for collecting data
<?php
function pf_test_author_leaderboard(){
$c = 0;
$the_query = new WP_Query(
array(
'post_type' => 'post',
'nopaging' => true,
'no_found_rows' => true,
'cache_results' => false,
@AramZS
AramZS / sanitize.php
Created May 7, 2015 17:19
Hyper-viligent WP sanitization from PressForward
/**
* Sanitize a string for use in URLs and filenames
*
* @since 1.7
* @link http://stackoverflow.com/questions/2668854/sanitizing-strings-to-make-them-url-and-filename-safe
*
* @param string $string The string to be sanitized
* @param bool $force_lowercase True to force all characters to lowercase
* @param bool $anal True to scrub all non-alphanumeric characters
* @return string $clean The cleaned string
@AramZS
AramZS / the-url-is-over-there.html
Last active August 29, 2015 14:14
Normal Canonical and OG:URL code
<link rel="canonical" href="http://jezebel.com/be-suspicious-of-the-new-harper-lee-novel-1683488258" />
<meta property="og:url" content="http://jezebel.com/be-suspicious-of-the-new-harper-lee-novel-1683488258" />
@AramZS
AramZS / bitly-response.php
Created February 3, 2015 22:35
What a Bit.ly-style redirect looks like as a wp_remote_get response.
<?php
# via var_dump(wp_remote_get('http://nzzl.me/1xqgPpn',array('redirection' => 0)));
array(5) {
["headers"]=>
array(9) {
["server"]=>
string(5) "nginx"
["date"]=>
@AramZS
AramZS / pf-ive-read.php
Created February 3, 2015 19:45
pf_ive_read
// Add Shortcode
function pf_total_wordcount_shortcode() {
$wc = 0;
$c = 0;
$the_query = new WP_Query(
array(
'nopaging' => true,
'date_query' => array(
'column' => 'post_date_gmt',
'after' => '30 days ago',
@AramZS
AramZS / all-ll.html
Last active September 25, 2017 12:05
LazyLoad techniques
<!-- http://www.vox.com/2015/1/29/7947263/media-internet-poetry -->
<img
class="vox-lazy-load m-chorus-asset__in-entry-body"
src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
alt=" "
data-chorus-asset-id="3356728"
data-full-size="https://cdn2.vox-cdn.com/thumbor/JjbTvM14EYv6600xMXvyxzNw4BA=/cdn0.vox-cdn.com/uploads/chorus_asset/file/3356728/Vox.0.png"
data-original="https://cdn1.vox-cdn.com/uploads/chorus_asset/file/3356728/Vox.0.png" />
<noscript>
<img