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
import clientThumbnailModule from './clientThumbnail' | |
import clientThumbnailController from './clientThumbnail.controller'; | |
import clientThumbnailComponent from './clientThumbnail.component'; | |
import clientThumbnailTemplate from './clientThumbnail.html'; | |
describe('clientThumbnail', () => { | |
let $rootScope, $q, makeController; | |
beforeEach(window.module(clientThumbnailModule)); |
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
class ClientThumbnailController { | |
constructor(ClientFactory, $mdDialog, $state) { | |
"ngInject"; | |
this.ClientFactory = ClientFactory; | |
this.sortOptions = { | |
"Sort by": '', | |
"name": 'data.commercialName', | |
"country": 'data.country.label', | |
} |
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
/***define the Home component here***/ | |
import React, { Component } from 'react' | |
class Home extends Component { | |
componentDidMount () { | |
// dispatch action to fetch users | |
this.props.fetchUsers() | |
} |
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
import { SESSION_SET_USER_INFO } from '../constants' | |
const sessionData = { | |
userName:'', | |
userId | |
} | |
const orders = { | |
orders: 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
// Session Actions | |
export const setSessionInfo = data => { | |
return { | |
payload: data, | |
type: SESSION_SET_USER_INFO | |
} | |
} | |
// Login Comp | |
onClickLoginBtn = dispatch => { |
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 arr = ['a','b','c','d','d','e','a','b','c','f','g','h','h','h','e','a']; | |
return arr.reduce(function(acc, cur) { | |
acc[cur] = (acc[cur] || 0) + 1; | |
return acc; | |
},{}); | |
// prints { a: 3, b: 2, c: 2, d: 2, e: 2, f: 1, g: 1, h: 3 } |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
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
/* Binary search algorithm implementation */ | |
function binarySearch(items,valueToFind){ | |
let start = 0 | |
let stop = items.length-1 | |
let middle = Math.floor( (start+stop) / 2 ) | |
let itemFoundAtPos = -1 | |
while( start < stop ){ | |
let itemInMiddlePos = items[middle] | |
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
sorted = True | |
numbers = [3, 5, 4, 2] | |
numbersLength = len(numbers) | |
while sorted: | |
sorted = False | |
for number in range(len(numbers)): | |
nextNumber = number + 1 | |
if nextNumber == numbersLength: | |
break |