This file contains hidden or 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
/* Simple css way to truncate line with ellipses at the end. Doesn't work with IE & Firefox*/ | |
:root { | |
--lines-to-show: 3; | |
--line-height: 18px; | |
--font-size: 16px; | |
} | |
.element-to-truncate { | |
display: block; | |
display: -webkit-box; | |
max-width: 100%; |
This file contains hidden or 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
<html> | |
<head> | |
<title>CSS Grid</title> | |
<style> | |
.grid { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); | |
grid-gap: 15px; | |
} | |
.grid div { |
This file contains hidden or 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
<html> | |
<head> | |
<style> | |
body { | |
background: #111; | |
cursor: none; | |
} | |
.cursor { | |
width: 30px; | |
height: 30px; |
This file contains hidden or 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
//https://stackoverflow.com/questions/2218999/remove-duplicates-from-an-array-of-objects-in-javascript?page=2&tab=oldest#tab-top | |
const things = [ | |
{place:"here",name:"stuff"}, | |
{place:"there",name:"morestuff"}, | |
{place:"there",name:"morestuff"} | |
]; | |
const filtered = things.filter(function({place, name}) { | |
const key =`${place}${name}`; |
This file contains hidden or 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
ipconfig /release; ipconfig /flushdns; ipconfig /renew; netsh winsock reset; netsh interface ipv4 reset; netsh interface ipv6 reset; netsh interface ip delete destinationcache; |
This file contains hidden or 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 "./styles.css"; | |
import { Suspense, useState, useEffect, Component } from "react"; | |
class ErrorBoundary extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { hasError: false }; | |
} | |
static getDerivedStateFromError(error) { |
This file contains hidden or 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
// sequentially get data from API while waiting for previous call to finish | |
for (let temp of arr) { | |
const res = await fetch('https://jsonplaceholder.typicode.com/users/' + temp).then(res => res.json()).then(res => res); | |
} | |
// sequentially get data from API asynchronously | |
const promises = Array(10).fill(null).map((item, index) => fetch(`https://jsonplaceholder.typicode.com/users/${index + 1}`).then(res => res.json()).then(res => res)); | |
for await (const item of promises) { | |
console.log(await item) | |
} |
This file contains hidden or 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
get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace("string to be replaced", "string to replace") } |
This file contains hidden or 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
Below link consists of all of the avatars you see on netflix inlcuding Squid Game, Lucifer, The crown, Money Heist and more.. | |
https://drive.google.com/file/d/1C0Il2a9g-l2RaELFDkMk7NTF7SqrM53Q/view?usp=sharing |
This file contains hidden or 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
// https://www.30secondsofcode.org/articles/s/javascript-object-comparison | |
const equals = (a, b) => { | |
if (a === b) return true; | |
if (a instanceof Date && b instanceof Date) | |
return a.getTime() === b.getTime(); | |
if (!a || !b || (typeof a !== 'object' && typeof b !== 'object')) | |
return a === b; | |
if (a.prototype !== b.prototype) return false; | |
const keys = Object.keys(a); | |
if (keys.length !== Object.keys(b).length) return false; |
OlderNewer