Skip to content

Instantly share code, notes, and snippets.

View SarathSantoshDamaraju's full-sized avatar
📽️
Doing time jumps

Krishna Sarath SarathSantoshDamaraju

📽️
Doing time jumps
View GitHub Profile
@SarathSantoshDamaraju
SarathSantoshDamaraju / index.ts
Last active June 28, 2023 05:14
countries-codes-exampleNumbers.js
// all credits to Mr. GPT. I just curated for my usecase and this is not a proprietary data
// and clubbed with contry codes from here https://github.com/jackocnr/intl-tel-input/blob/master/src/js/data.js
{
"countries": [
{
"name": "Afghanistan",
"code": "+93",
"example_number": "0799 123 456",
"countryCode": "af"
},
@SarathSantoshDamaraju
SarathSantoshDamaraju / snippet.js
Last active August 16, 2022 20:48
Puppeteer script to get performance metrics
// Puppeteer snippet to get performance metrics images from Google Page insights, PingDom, gtmetrix
/* Requirements
* 1. Node js >= 10
* 2. Puppeteer, npm i -g puppeteer | yarn global add puppeteer
*/
/* Execution
* 1. save the file to a name, say `snippet.js`
* 2. Run "node snippet.js [urls]". Eg., "node snippet.js http://example.com http://sample.com"
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@SarathSantoshDamaraju
SarathSantoshDamaraju / .Frontend Technical Interview Prep.md
Created February 13, 2020 07:29 — forked from augbog/.Frontend Technical Interview Prep.md
Frontend Technical Interview Prep: A study guide of things I constantly re-review when interviewing for frontend.

Frontend Technical Interview Prep

EDIT: Well this has been linked now so just an FYI this is still TBD. Feel free to comment if you have suggestions for improvements. Also here is an unrolled Twitter thread of a lot of the tips I talk about on here.

I've been doing frontend for a while now and one thing that really gripes me is the interview. I think the breadth of knowledge of a "Frontend Engineer" has been so poorly defined that people really just expected you to know everything. Many companies have made this a hybrid role. The Web is massive and there are many MANY things to know. Some of these things are just facts that you learn and others are things you really have to understand.

Every time I interview, I go over the same stuff. I wanted to create a gist of the TL;DR things that would jog my memory and hopefully yours too.

Lots of these things are real things I've been asked that caught me off guard. It's nice to have something you ca

@SarathSantoshDamaraju
SarathSantoshDamaraju / index.js
Last active November 13, 2019 12:07
Intl() gist #1
'use strict;'
let timeDiff = Math.ceil((new Date('2019-11-12T11:38:02.787Z') - new Date())/86400000);
/*
86400000 is to convert the time to days.
1000 to convert it into seconds
1000*60 to convert it into minutes
1000*60*60 to convert it into Hours
*/
const localTimeString = new Intl.RelativeTimeFormat('en', { numeric: 'auto'});
@SarathSantoshDamaraju
SarathSantoshDamaraju / file.js
Created September 20, 2019 07:07
Ember relationships with [github API]
/*
Using ember relation ships with API similar to github
Adpater: RESTAdapter
Serialiser: JSONSerializer
*/
/*
Create a parent model
*/
@SarathSantoshDamaraju
SarathSantoshDamaraju / Comparison Table
Created August 1, 2019 07:52
Button types Comparison Table
| | innerText | value | aria-label | aria-lebelledby | role or aria-role | tabindex
// HBS
{{#if label}}
{{label}}
{{else}}
{{yield}}
{{/if}}
// JS
import Component from '@ember/component';
import Ember from 'ember';
import {computed} from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
data: ["One","Two","Three"],
datas : computed('data','typed', function(){
return this.data.filter(each => each.toLowerCase().includes(this.typed ? this.typed : ''));
}),
@SarathSantoshDamaraju
SarathSantoshDamaraju / script.js
Created January 30, 2019 06:26
Copy function value to clipboard with Pure JS
/* ====
ClipboardCopy: This accepts any given string and copys it into clipboard after desired operation.
==== */
function ClipboardCopy(str){
/* Some login */
str = str.toLowerCase();
let convertedStr = str.split(" ").join("-");
/* Copy code */
let $tempInput = document.createElement('INPUT');
document.body.appendChild($tempInput);