Skip to content

Instantly share code, notes, and snippets.

using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Script.Serialization;
namespace RetailerUrlStatusChecker
@elmogallen
elmogallen / user.lua
Last active December 15, 2023 13:04
My user settings for ZeroBrane Studio: makes it closer to Sublime Text and Lua Glider, keeps shortcut keys consistent as I go back and forth from Windows to OS X, adjusts the default settings, adds a "well" for the line numbers and code folding arrows, and generally makes some UI elements more subtle (code folding, indent guides).
--[[--
Use this file to specify User preferences.
Review [examples](+/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/cfg/user-sample.lua) or check [online documentation](http://studio.zerobrane.com/documentation.html) for details.
--]]--
editor.fontsize = 14
editor.usewrap = false
editor.tabwidth = 4
editor.indentguide = true
editor.fold = true
editor.foldtype = 'arrow'
@elmogallen
elmogallen / CMSHttpApplication.cs
Created July 11, 2014 13:30
Adding Web API to Kentico 7 (ASP.NET)
/// *******************************************************************************************************************
/// **** THIS IS AN EXCERPT; I'M ONLY SHOWING RELEVANT PARTS OF THIS FILE, ALONG WITH NOTES ON HOW TO MAKE IT WORK ****
/// *******************************************************************************************************************
/// Mostly based on info found here: http://devnet.kentico.com/forums/f68/fp12/t34518/using-web-api-with-kentico
/// NOTE: The following DLLs seemed to be necessary for this to work properly and not blow up Kentico:
/// Newtonsoft.Json.dll
/// System.Net.Http.dll
/// System.Net.Http.Formatting.dll
@elmogallen
elmogallen / CoronaStickToTopAndBottom.lua
Created February 13, 2014 21:21
Make stuff stick to the top or bottom of the screen in Corona SDK.
-- Putting a rectangle at the bottom of the screen and having it expand
-- all the way across the screen, like a status bar.
-- Important to note: I'm using "Letterbox" mode in my config.lua
local actualBottomY = display.contentHeight - display.screenOriginY
local actualTopY = display.screenOriginY
local deviceWidth = ( display.contentWidth - (display.screenOriginX * 2) ) / display.contentScaleX
local scaleFactor = deviceWidth / display.actualContentWidth
local actualWidth = (deviceWidth / scaleFactor)
local actualLeftX = (display.contentWidth - actualWidth) * .5
@elmogallen
elmogallen / BVSingleProductExample.js
Created February 10, 2014 16:04
How to use the Bazaarvoice API to completely handle styling and displaying the star rating and "Read reviews" links. Also shows an accurate number of reviews. Requires loading the bvapi.js first.
// PLACE THIS HTML where you want the star rating and "Read x Reviews" to show up
// <div id="bvReview" data-productid="3898"></div>
// ..................... Javascript for bazaarvoice reviews and ratings for a single product .................................
$(document).ready(function() {
// This part just readies the bvReview DIV to be filled with the star rating and a "Read reviews" link
var bvrrDiv = $('#bvReview');
var productId = bvrrDiv.attr("data-productid");
bvrrDiv.append("<div id='BVRRInlineRating-" + productId + "'>");
@elmogallen
elmogallen / AsynchronousBazaarvoice.js
Created January 27, 2014 21:11
How to determine whether a product is setup in the Bazaarvoice system, and then getting an accurate number of reviews minus those that are RatingsOnly. Asynchronously. You would see your product list first, then either the star ratings or "Read reviews", and then finally you might see "Read reviews" change to "Read 17 reviews" for example.
// Bazaarvoice Ratings and Reviews Div
liBody += "<div id='review-" + dealerId.toString() + "' style='margin-left:16px;'></div>";
// ...
// ... much later ...
// ...
// Bazaarvoice related configuration script
@elmogallen
elmogallen / BVProductList.html
Last active January 4, 2016 06:49
Inline Bazaarvoice Ratings and Reviews with Read Reviews link
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- TODO:
Do some kind of loop here to show your results.
Inside the loop, you'd generate HTML similar to the following: -->
<div id="BVRRInlineRating-{productId}"></div>
<a href="" class="bvReadReviews" data-pid="{productId}">Read reviews</a>
<!-- End Loop That Generates HTML for results -->