Skip to content

Instantly share code, notes, and snippets.

View kksrini89's full-sized avatar
🎯
WFH

Srinivasan K K kksrini89

🎯
WFH
View GitHub Profile
@kksrini89
kksrini89 / index.ts
Created May 12, 2021 08:13
Protractor Utilities - Frequently used
To run scripts
---------------
browser.executeScript("document.querySelector('.products-wrapper').scrollIntoView({ behavior: 'auto' })"); // Return Type: Promise
To resolve Array of Promises sequentially,
------------------------------------------
let zIndex = 0;
const items = element.all(by.css('.product'));
@kksrini89
kksrini89 / .block
Created January 13, 2021 13:59 — forked from laxmikanta415/.block
Donut chart with labels our side with polylines d3 v4
license: mit
@kksrini89
kksrini89 / Findings & Utilities.txt
Last active April 22, 2021 10:17
Important findings
Microsoft windows terminal settings.json info
https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md
Download videos with Youtube
-----------------------------
Array.from(document.querySelectorAll("body > ytd-app #content #wc-endpoint")).forEach((item, i) => {
const href = item.getAttribute('href');
const url = `https://www.ssyoutube.com/${href}`;
@kksrini89
kksrini89 / countries.json
Created February 17, 2020 06:22 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@kksrini89
kksrini89 / git_commands.txt
Last active December 6, 2022 07:06
Git Essentials - Daily
branch name modify both local and remote (Do step by step DONT modify the steps)
--------------------------------------------------------------------------------
WAY 1
-------
> git branch -m <new_name>
> git push origin -u <new_name>
> git push origin --delete <old_name>
@kksrini89
kksrini89 / app.component.ts
Last active August 17, 2021 10:21
Downloading file in Angular - from Node.js
downloadFile(token: string, url: string) {
try {
let headers = new HttpHeaders()
.set(
'Authorization',
`Bearer ${token}`
)
.set('Accept', 'text/csv');
this.http
.get(`${url}`, {
@kksrini89
kksrini89 / tutorial.md
Created July 21, 2018 07:11 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@kksrini89
kksrini89 / auth.service.ts
Created April 24, 2018 07:48 — forked from codediodeio/auth.service.ts
Angular4 Firebase authentication service using OAuth, Anonymous, and Email/Password. Designed specifically for changes introduced in AngularFire2 4.0.0
import { Injectable } from '@angular/core';
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Router } from "@angular/router";
import * as firebase from 'firebase';
@Injectable()
export class AuthService {
@kksrini89
kksrini89 / gist:e8d26f99b10acffc738d65e4dd12c59e
Created August 25, 2016 16:42
Fcc backend for Nodejs challenges.
//Challenge 13
var http = require("http");
var url = require("url");
var httpServer = http.createServer(function(req,res) {
var reqUrl = url.parse(req.url,true);
var dateObject = new Date(reqUrl.query.iso);
var result;
if(req.url.search('parsetime') !== -1){
result = {
"hour": dateObject.getHours(),
@kksrini89
kksrini89 / gist:f7a5052b7f05459eef6394af03e91eb0
Last active August 25, 2016 03:06
With Multiple GET action methods-WebAPI
//angular service
contact.search = function (inputName) {
return $http({
method: 'GET',
url: url + 'api/contact/search',
//params: { name: inputName }
data: { name: inputName }
});
//return $http.get(url + 'api/contact/search', name);