Skip to content

Instantly share code, notes, and snippets.

View brs14ku's full-sized avatar
👋
Hellooooooooooo!

Brent Schultz brs14ku

👋
Hellooooooooooo!
View GitHub Profile
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
@brs14ku
brs14ku / gist:f8d4a890f199c5fdd353d16cb16ed55a
Last active May 9, 2017 02:33
Add to your nginx.conf for packrip
# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpe?g|gif|ico)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
proxy_pass https://YOURURLHERE/$uri;
@brs14ku
brs14ku / local.domain.com.conf
Created November 2, 2016 02:44 — forked from oxocode/local.domain.com.conf
VVV Nginx Configuration
# VVV Nginx Configuration
# oxocode
# - Uses proper domain.com extension for verifying
# third party APIs are loading / ads are being served.
# - Allows access to localhost via mobile
# - Uses xip.io for testing RWD via mobile
#
# Assumptions: These rules assume that your
# development site was created in 'local.domain.com'
# within your vagrant public root
@brs14ku
brs14ku / ga.js
Created October 12, 2016 16:18
Sample GA adapter
/**
* ga.js - analytics adapter for google analytics
*/
var events = require('./../../events');
var utils = require('./../../utils');
var CONSTANTS = require('./../../constants.json');
var BID_TIMEOUT = CONSTANTS.EVENTS.BID_TIMEOUT;
var BID_WON = CONSTANTS.EVENTS.BID_WON;
<?php
$players = array(
'1B' => array(
'profile_data' => array(
'first_name' => 'Anthony',
'last_name' => 'Rizzo'
),
'stats' => array(
'avg' => .334,
'hr' => 25,
@brs14ku
brs14ku / srcset.html
Created October 4, 2016 18:56
ykc img src set
<img src="http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-150x150.jpg" srcset="http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-300x200.jpg 300w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-768x512.jpg 768w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-1024x682.jpg 1024w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-465x310.jpg 465w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-670x446.jpg 670w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-230x153.jpg 230w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-440x293.jpg 440w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-145x97.jpg 145w, http://yeahkc.dev/wp-content/uploads/2016/09/517fde84-e2f5-36ae-af1e-c91daaa1ebc4-350x233.jpg 350w, http://yea
@brs14ku
brs14ku / batcache-variant.php
Created May 16, 2016 21:26
mobile detect batcache variant
function mysite_is_mobile()
{
$isMobile = preg_match("#(ipod|iphone|android|opera mini|blackberry|pre/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)#i", $_SERVER['HTTP_USER_AGENT'] );
return $isMobile == 1 ? true : false;
}
$batcache->unique['mobile'] = mysite_is_mobile();
@brs14ku
brs14ku / web128sp16class2
Last active March 10, 2016 22:26
Web 128 Class 2 Spring 2016
<form>
First name:<br>
<input type="text" name="firstname"><br>
Last name:<br>
<input type="text" name="lastname">
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
<input type="submit" value="Submit">
</form>
@brs14ku
brs14ku / gist:77a2fb453b47ae65c248
Last active January 29, 2016 16:02
session and GET
if ( ( isset( $_GET['utm_medium'] ) && $_GET['utm_medium'] == 'pc' ) || ( isset( $_SESSION['utm_medium'] ) && $_SESSION['utm_medium'] == 'pc' ) {
$my_div = '<div class="A">THIS IS A</div>';
} else {
$my_div = '<div class="B">THIS IS B</div>';
}
echo $my_div;
@brs14ku
brs14ku / gist:f63f1c440b9e81d2a8ba
Last active October 25, 2015 17:17
Scrape images preprod
wp migrate-abacus scrape_media_content --post_type=pehub-vc-journal --chunk=7000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=5000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=10000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=15000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=20000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=25000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=30000
wp migrate-abacus scrape_media_content --post_type=pehub-buyouts --chunk=5000 --offset=35000
wp migrate-abacus scrape_media_content --post_type=pehub-digital-edition --chunk=150