Skip to content

Instantly share code, notes, and snippets.

View lovubuntu's full-sized avatar
🎯
Focusing

Prabu K lovubuntu

🎯
Focusing
  • https://www.quintype.com
  • Chennai
View GitHub Profile
@lovubuntu
lovubuntu / data.js
Created October 24, 2018 17:39
Data Setup
const oldSelectedList = [
{id: 1, name: 'apple', serverAttribute1: 'some value', serverAttribute2: 'some value'},
{id: 2, name: 'orange', serverAttribute1: 'some value', serverAttribute2: 'some value'}
];
const newlySelectedList = [
{id: 3, name: 'grape'},
{id: 2, name: 'orange'}
];
@lovubuntu
lovubuntu / old_method.js
Created October 24, 2018 17:40
First try with lodash
let _ = require('lodash');
const unionList = _.unionWith(oldSelectedList, newlySelectedList, (o, n) => o.id === n.id);
const finalList = _.intersectionWith(unionList, newlySelectedList, (u, n) => u.id === n.id);
@lovubuntu
lovubuntu / method_chaining.js
Created October 24, 2018 17:41
Using method chaining in lodash
let _ = require('lodash');
const finalList = _.chain(oldSelectedList)
.unionWith(newlySelectedList, (o, n) => o.id === n.id)
.intersectionWith(newlySelectedList, (u, n) => u.id === n.id)
.value();
@lovubuntu
lovubuntu / hosts_file
Created January 8, 2019 09:58
/etc/hosts file after adding new entry for custom domain
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Add your domain name here
@lovubuntu
lovubuntu / package.json
Last active January 16, 2019 09:17
Default package.json generated by angular
{
"name": "angular-with-ci-cd",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
@lovubuntu
lovubuntu / initial_travis.yml
Last active January 16, 2019 06:37
Initial Travis configuration file
language: node_js
node_js:
- "10.4.1"
sudo: true
addons:
chrome: stable
branches:
only:
@lovubuntu
lovubuntu / ci.protractor.conf.js
Created January 16, 2019 07:13
Protractor configuration for CI
...
capabilities: {
chromeOptions: {
args: [ "--headless" ]
},
'browserName': 'chrome'
},
...
@lovubuntu
lovubuntu / package.json
Last active January 16, 2019 10:03
Updated package file with scripts to run unit and e2e tests in headless mode
{
"name": "angular-with-ci-cd",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
@lovubuntu
lovubuntu / .travis.yml
Last active January 16, 2019 09:01
Updated scripts
script:
- yarn all_tests #Uses yarn to run our custom script all_tests
- yarn build --prod --base-href $base_href
@lovubuntu
lovubuntu / .travis_intermediate.yml
Last active January 16, 2019 09:47
Travis configuration with appropriate command line arguments for running tests in headless mode.
script:
- yarn lint
- ng test --watch false --browsers ChromeHeadless
- ng e2e --protractor-config='e2e/protractor.ci.conf.js'
- yarn build --prod --base-href $base_href