Skip to content

Instantly share code, notes, and snippets.

@stariqmi
stariqmi / webpack.config.js
Created January 28, 2017 03:10
Webpack config file
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
main: './public/js/main.js'
},
output: {
path: __dirname + '/public/js/',
filename: '[name].bundle.js'
// Render HTML code for an order summary
function order_summary(order_object) {
var price = 0,
tax = 0,
subtotal = '',
html = '';
switch (order_object.price_level) {
case 'free':
// Do nothing, default is 0!
@stariqmi
stariqmi / index.js
Created May 15, 2016 17:52
Shopify Coding Challenge
/*
Author: Salman Tariq Mirza
node/JavaScript solution to the Shopify Internship Coding Challenge
Assumptions:
- No duplicates, a flat list of the variants of all the products maintains uniqueness.
- For each computer there should be a keyboard.
- However if all computers/keyboards are purchased and there is still money left,
then spares need to be purchased of the remaining type.
@stariqmi
stariqmi / sample_geocode.js
Created June 23, 2014 23:33
Geocoded Data from Angualr service
// Creating a new angular module
var app = angular.module("GeocodeApp", []);
// Angular Service
// Assuming the variable $GoogleAPI represents the Google API to geocode data
app.service("GecodeDataService", function($GoogleAPI) {
var that = this;
this.listings = {};
// Set some sample listing