Skip to content

Instantly share code, notes, and snippets.

View painteddigital's full-sized avatar

Matt Reed painteddigital

View GitHub Profile
@painteddigital
painteddigital / require-boilerplate.js
Created March 28, 2012 17:10
Generic RequireJS page template
define([], function(){
var Page = {
init: function(){
}
}
return Page;
});
<html>
<head>
<style type="text/css">
body{
font-size: 100%; /* 16px */
}
h1{
font-size: 2rem; /* 32px */
}
h2{
@painteddigital
painteddigital / Inject VelocityJS
Last active April 12, 2017 15:53
Paste this into your console to play with velocity on a page that doesn't have it. It assumes jQuery exists already
(function() {
var url = ["cdn.jsdelivr.net/velocity/1.1.0/velocity.min.js","cdn.jsdelivr.net/velocity/1.1.0/velocity.ui.min.js"];
for(var i=0; i < url.length; i++){
var v = document.createElement('script'); v.type = 'text/javascript'; v.async = true;
v.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + url[i];
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(v, s);
}
})();
@painteddigital
painteddigital / Add image asset with bounce-in animation
Created January 12, 2015 09:10
Adds image from library to a parent view and animates it by growing from the center with a springy bounce
- (void)addCompletionCheck {
// image asset. Change to whatever your's is named
UIImage *check = [UIImage imageNamed:@"uploadCompleteCheck"];
UIImageView *checkImageView = [[UIImageView alloc] initWithImage:check];
// create a view to house the check and for animating
UIView *checkView = [UIView new];
// Calculate position based on parent and initial size of asset
// Math is such that it puts the image in the center of parent
// self.progressView is the parent view in this case. Change to your superview
/*
TODOS:
- Add listener for user changing DOM DTP
- Add local variable to store in
- QA DTP logic
- Test sort options for sending to search
- Add Optimizely logging when JSON loads fail
*/
.rest-row-topreview .stars:before {
font-size: .875rem; /* shrinks stars down from 16px to 14px */
letter-spacing: 0.05rem; /* spaces stars out so they're not smushed */
}
.rest-row-topreview .star-cont {
margin-right: .5rem; /* slightly decrease margin from 16px to 8px */
}
.rest-row-popoffers .rest-row-meta, .rest-row-popoffers .topreview-container, .rest-row-topreview .rest-row-meta, .rest-row-topreview .topreview-container {