This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<h1>The 10 column complex nested grid AG test</h1> | |
<div class="ag ag1"> | |
<h2>AG 1</h2> | |
</div> | |
<!-- /ag1 --> | |
<!-- ag4 to ag7 are nested within ag2.--> | |
<div class="ag ag2"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputString = "dilip %s Kumar %s"; | |
var finalString; | |
function manipulateString(param) { | |
finalString = inputString; | |
for(var i = 0; i <= arguments.length; i++) { | |
finalString = finalString.replace('%s',arguments[i]); | |
} | |
return finalString; | |
} | |
console.log(manipulateString("is", "cool")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var counter = 0, // to keep track of current slide | |
$items = document.querySelectorAll('.slideshow figure'), // a collection of all of the slides, caching for performance | |
numItems = $items.length; // total number of slides | |
var ImageSlider = function() { | |
this.bindEvents.call(this); | |
}; | |
ImageSlider.prototype.bindEvents = function() { | |
var self = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Module to check if two objects are euqal*/ | |
var isObjectsEqual = function(a, b) { | |
var aProp = Object.getOwnPropertyNames(a); | |
var bProp = Object.getOwnPropertyNames(b); | |
if(aProp.length != bProp.length) { | |
console.log("Objects are not equal"); | |
return false; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This piece has been taken from React.js Conf 2015 - Immutable Data and React | |
*/ | |
function memoize(fn) { | |
var prevArg; | |
var prevResult; | |
return function(arg) { | |
return arg === prevArg ? | |
prevResult : | |
(prevArg = arg, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var measureCRP = function measureCRP() { | |
var t = window.performance.timing, | |
interactive = t.domInteractive - t.domLoading, | |
dcl = t.domContentLoadedEventStart - t.domLoading, | |
complete = t.domComplete - t.domLoading; | |
var stats = document.createElement('p'); | |
stats.textContent = 'interactive: ' + interactive + 'ms, ' + | |
'dcl: ' + dcl + 'ms, complete: ' + complete + 'ms'; | |
document.body.appendChild(stats); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const removeBaseUrl = (url) => { | |
/* | |
* Replace base URL in given string, if it exists, and return the result. | |
* | |
* e.g. "http://localhost:8000/api/v1/blah/" becomes "/api/v1/blah/" | |
* "/api/v1/blah/" stays "/api/v1/blah/" | |
*/ | |
const baseUrlPattern = /^https?:\/\/[a-z\:0-9.]+/; | |
let result = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This Google Sheets script keeps data in the specified column sorted any time | |
* the data changes. | |
* | |
* After much research, there wasn't an easy way to automatically keep a column | |
* sorted in Google Sheets, and creating a second sheet to act as a "view" to | |
* my primary one in order to achieve that was not an option. Instead, I | |
* created a script that watches for when a cell is edited and triggers | |
* an auto sort. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reducer | |
export default function fetchDeliveryAddress(state = initialState, action){ | |
switch(action.type){ | |
case FETCH_DELIVERY_ADDRESS_LIST_SUCCESS: | |
return { | |
...state, | |
deliveryAddressList: action.deliveryAddressList, | |
deliveryDetailsState: action.deliveryDetailsState | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getDeliveryAddress(some_state) { | |
return function(dispatch) { | |
axios(some_config_object) | |
.then(function(response) { | |
let deliveryDetailsState; | |
const deliveryAddressList = response.data.payload; | |
let updatedDeliveryAddressList = deliveryAddressList.map((item, index) => { | |
if(index !== 0) { |
OlderNewer