Skip to content

Instantly share code, notes, and snippets.

View iamkevingreen's full-sized avatar
💭
🍝 🍝 🍝 🍝 🍝 🍝

Kevin Green iamkevingreen

💭
🍝 🍝 🍝 🍝 🍝 🍝
View GitHub Profile
transition: all 0.25s ease-out, -webkit-transform 0.25s ease-out;
transition-delay: 0s;
let handleScrolling = () => {
Parallax.init(imageFloatTwo, -4.3);
Parallax.init(imageFloatThree, -2);
Parallax.init(earnedImageTwo, -7);
Parallax.init(earnedImageThree, -13);
Parallax.init(sparkText, -13);
Parallax.init(heroText, -13);
Parallax.init(imageFloatOne, -6);
}
window.addEventListener('scroll', handleScrolling);
let Parallax = {
init(el, displace) {
this.animateItem(el, displace);
},
setPosition() {
if (window.pageYOffset !== undefined) {
return window.pageYOffset;
} else {
return (document.documentElement || document.body.parentNode || document.body).scrollTop;
}
let scrollPosition = 0;
let setPosition = () => {
if (window.pageYOffset !== undefined) {
scrollPosition = window.pageYOffset;
} else {
scrollPosition = (document.documentElement || document.body.parentNode || document.body).scrollTop;
}
};
/**
* Shopify Client API
*/
var Shopify = {}
var API = Shopify.API = function ShopifyAPI(options) {
this.config = {
shop: options.shop,
...
<fieldType name="string" class="solr.StrField" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.EdgeNGramFilterFactory" minGramSize="2" maxGramSize="15" side="front"/>
</analyzer>
@iamkevingreen
iamkevingreen / htaccess gzip
Created October 9, 2013 15:13
Gzip htaccess
# 480 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>
@iamkevingreen
iamkevingreen / new_gist_file
Created August 16, 2013 18:14
SVG Fallbacks
<svg width="96" height="96">
<image xlink:href="svg.svg" src="svg.png" width="96" height="96"/>
</svg>
And here the magic: browsers which support SVG will read the code as:
<svg width="96" height="96">
<image xlink:href="svg.svg" width="96" height="96"/>
</svg>
ignoring src attribute and will show SVG image.
@iamkevingreen
iamkevingreen / new_gist_file
Created July 11, 2013 15:26
Placeholder FIX for IE (js)
(function($) {
$.fn.placeholder = function() {
if(typeof document.createElement("input").placeholder == 'undefined') {
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {