Skip to content

Instantly share code, notes, and snippets.

@vsakaria
vsakaria / DRY this code up using Function.prototype.call
Last active Sep 26, 2016
Demonstrating my understanding of call and apply
View DRY this code up using Function.prototype.call
var ComparisonTable = (function ($) {
var init = function () {
$("td, th").on('mouseenter',function() {
var col = $(this).parent().children().index($(this));
$('.eh-column').each(function () {
$(this).removeClass();
});
$('#column-' col).attr('class', 'column-boarder');
View productItemLayout.js
require('entities/productDetails/hotelImages');
require('../views/productAllInfo');
var App = require('src/app');
var Backbone = require('backbone');
var Marionette = require('backbone.marionette');
var layoutTemplate = require('../templates/product.hbs');
var Gallery = require('brg-ui-gallery');
View productItemLayout.spec.js
var _ = require('underscore');
var Backbone = require('backbone');
var Marionette = require('backbone.marionette');
var App = require('../../../../../src/app');
var ProductItemLayout = require('../../../../../src/lib/components/productCard/layout/productItemLayout');
var productsCardChannel = Backbone.Wreqr.radio.channel('productsCard');
describe('Product Item Layout View', function () {
beforeEach(function () {
View productListController.spec.js
var $ = require('jquery');
var _ = require('underscore');
var Backbone = require('backbone');
var Marionette = require('backbone.marionette');
var ProductShowController = require('apps/products/show/productShowController.js');
var App = require('src/app.js');
var productsShowChannel = Backbone.Wreqr.radio.channel('productsShow');
describe('productShowController', function () {
View productListController.js
require('./layout/searchResultsLayout');
require('./views/productList');
require('entities/map.js');
require('./views/mapView');
//Service dependencies
require('services/search');
require('services/modifyProduct');
require('services/productInfo');
View mapView.js
var Backbone = require('backbone');
var Marionette = require('backbone.marionette');
var _ = require('underscore');
var mapTemplate = require('../templates/map.hbs');
var getThemeAssets = require('../../../../helpers/getThemeAssets');
var productsListChannel = Backbone.Wreqr.radio.channel('productsList');
var MapView = Marionette.ItemView.extend({
View mapView.spec.js
var Backbone = require('backbone');
var MapView = require('../../../../../src/apps/products/list/views/mapView');
var productsListChannel = Backbone.Wreqr.radio.channel('productsList');
describe('Map View', function () {
beforeEach(function () {
window.google = {
maps: {}
};
@vsakaria
vsakaria / _media32.scss
Created Sep 30, 2015 — forked from benfrain/_media32.scss
A Sass 3.2 mixin for dealing with Media Queries
View _media32.scss
// Here are some variables, then a mixin and then an application of the mixin - this will only compile using Sass 3.2
//variables
$XS: 12.5em; // 200px;
$S: 18.75em; // 300px
$SM: 35em; // 560px
$M: 47.5em; // 760px
$L: 63em; // 1008px
$XL: 110em; // 1760px
$XXL: 180em; // 2880px
View HTML5-Markup-Template---Basic.markdown

HTML5 Markup Template - Basic

A very basic starter template with fundamental HTML5 markup -- only the basics.

Based on HTML5 Bones | http://html5bones.com

View JSCS config
{
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
You can’t perform that action at this time.