Skip to content

Instantly share code, notes, and snippets.

// When doing smart SEO advanced you will check for the existence of a URL parameter named bvrrp.
// If that parameter exists, you will check to make sure that file exists on disk, and then include it.
// For example, if the product id was 6789 and page 2 was being requested, the parameter bvrrp would be 1230-en_us/reviews/product/2/6789.htm.
// If that parameter doesn't exist, you will default to including page 1.
// Here is an example function you might write to handle this logic.
function getRRSmartSEOFile() {
$SEOParam = getURLParameter('bvrrp');
$SEOFile = '/path/to/smartseo/' + $SEOParam;
@charleshimmer
charleshimmer / gist:1217685
Created September 14, 2011 20:27
DoShowContent
$BV.ui('rr', 'show_reviews', {
productId: '67760',
submissionContainerDiv: 'BVRRContainer',
doShowContent: function(){
// place logic here to show the reviews tab
}
});
@charleshimmer
charleshimmer / gist:1285195
Created October 13, 2011 19:10
Update Bengay Integration Code
$BV.configure('global', {
allowSamePageSubmission: true,
doShowSubmission: function() {
tb_show('', '#TB_inline?height=auto&width=730&modal=true&inlineId=submissioncon','');
},
onSubmissionReturn: function() {
tb_remove();
},
doScrollSubmission: function() {
return false;
@charleshimmer
charleshimmer / gist:1514696
Created December 23, 2011 16:40
Testing autofocus
function featureTest(element, attribute);
var el = document.createElement('input');
if(attribute in el){
return true;
else{
return false;
}
}
@charleshimmer
charleshimmer / gist:1674669
Created January 25, 2012 04:14
One time computation
function getQueryParams(param) {
var qs = document.location.search.split("+").join(" "),
params = {},
tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
}
@charleshimmer
charleshimmer / gist:1790409
Created February 10, 2012 15:50
Lamen explanations of programming concepts

Objects

The concept of an “object” in programming is a made up abstraction to make programming easier. Computers don’t require us to use objects to code software. Humans invented this concept to make building, organizing, and maintaining code easier and consistent. What computer scientists really did was steal this pattern from dealing with real objects we work with everyday.

Let’s take a car for example. A car is an object that can do certain things. A car can drive, break, turn, and lock the doors. If we were to implement a car in our code we would create an object and call it “Car”. This car object would have methods (fancy word for functions that are defined in an object) that could drive(), turn(), brake(), and lockDoors(). The actual syntax would look something like this if you were doing this in JavaScript:

var car = new Car(); // manufacture a new car object and store it in a variable

car.drive(); // make the car drive
car.brake(); // make the car brake

@charleshimmer
charleshimmer / gist:2998747
Created June 26, 2012 20:34
Rough JSON schema for Salesforce data
[{
clientFamily: Walmart,
accounts:[{
name: Walmart-CA,
ASF: 500000,
numCase: 34,
productsSold: [...]
productsLive: [...]
folders:[{
name: Walmart
@charleshimmer
charleshimmer / gist:3834640
Created October 4, 2012 16:07
SkilTools sample display integration code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<script src="//skiltools.ugc.bazaarvoice.com/bvstaging/static/4853/bvapi.js"></script>
@charleshimmer
charleshimmer / exampleBV.js
Created November 7, 2012 18:21
Conversations 2013 Integration Code
// Step 1 - make sure the BV divs are on the page. The placement of these divs dictate where BV will inject it's content
// BV Summary Container (for both RR and QA)
<div id="BVRRSummaryContainer"></div>
// BV RR Container
<div id="BVRRContainer"></div>
// BV QA Container (Optional)
<div id="BVQAContainer"></div>
@charleshimmer
charleshimmer / BV.html
Created December 7, 2012 21:03
NewYork & Company BV Integration Code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<script src="//newyorkcompany.ugc.bazaarvoice.com/static/3510-en_us/bvapi.js"></script>
<script>