Skip to content

Instantly share code, notes, and snippets.

View elitenomad's full-sized avatar
🎯
Focusing

Pranava S Balugari elitenomad

🎯
Focusing
View GitHub Profile
<div id="trapezium">
</div>
<div id="curvedarrow">
</div>
<div id="curvedarrow">
</div>
@elitenomad
elitenomad / index.html
Created July 27, 2020 04:13
Shapes and CSS
<div class="square"></div>
<div class="rectangle"></div>
<div class="circle"></div>
<div class="oval"></div>
<div class="triangle-up"></div>
<div class="triangle-down"></div>
<div class="triangle-left"></div>
<div class="triangle-right"></div>
<div class="triangle-top-left-shape"></div>
<div class="triangle-top-right-shape"></div>
@elitenomad
elitenomad / sachin-data-by-year.json
Created April 5, 2020 09:42
Sachin data by year
[
{
"year": "1989",
"matches": 1,
"runs": 0,
"highest_score": "0",
"batting_avg": 0,
"no_of_100s": 0,
"wickets": "-",
"best_bowling": "-",
@elitenomad
elitenomad / debounce.js
Created February 21, 2020 02:25
simple implementation of debounce functionality (Type ahead functionality)
function debounce(fn, time) {
let setTimeOutId;
const context = this;
return function() {
if(setTimeoutId) {
clearTimeout(setTimeoutId);
}
setTimeoutId = setTimeout(function(){
@elitenomad
elitenomad / debounce.js
Created February 21, 2020 02:25
simple implementation of debounce functionality (Type ahead functionality)
function debounce(fn, time) {
let setTimeOutId;
const context = this;
return function() {
if(setTimeoutId) {
clearTimeout(setTimeoutId);
}
setTimeoutId = setTimeout(function(){
@elitenomad
elitenomad / bind.js
Created February 21, 2020 01:45
implement function.prototype.bind
function.prototype.bind = function(context) {
var fn = this
return function(){
fn.call(context);
}
}
@elitenomad
elitenomad / flatten.js
Last active February 21, 2020 01:26
Flatten array of nested arrays Javascript
function flatten(arr) {
a = []
arr.forEach((s) => {
if(Array.isArray(s)){
a = a.concat(flatten(s))
}else{
a.push(s)
}
})
@elitenomad
elitenomad / remove_duplicates.js
Last active February 21, 2020 00:27
Remove duplicate strings Javascript
function removeDuplicate(str) {
arr = []
prev_value = ''
splitted_str = str.split(' ')
splitted_str.forEach((s) => {
console.log("prev value", prev_value)
console.log("s value", s)
if(s !== prev_value) {
arr.push(s);