One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
// Note: this gist is a part of this OSS project that I'm currently working on: https://github.com/steven-tey/dub | |
export default async function getTitleFromUrl (url: string) { | |
const controller = new AbortController(); | |
const timeoutId = setTimeout(() => controller.abort(), 2000); // timeout if it takes longer than 2 seconds | |
const title = await fetch(url, { signal: controller.signal }) | |
.then((res) => { | |
clearTimeout(timeoutId); | |
return res.text(); | |
}) |
// components/BlurImage.js | |
import Image from 'next/image'; | |
import { useState, useEffect } from 'react'; | |
import cn from 'clsx'; | |
export default function BlurImage(props) { | |
const [isLoading, setLoading] = useState(true); | |
const [src, setSrc] = useState(props.src); | |
useEffect(() => setSrc(props.src), [props.src]); // update the `src` value when the `prop.src` value changes |
<? | |
// | |
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio) | |
// | |
// File: twitterFollowerCuratorBot.php | |
// | |
// Created: May 2021 | |
// License: MIT | |
// |
:root { | |
--font-size: 15.5px; | |
--font-color: hsl(205, 23%, 16%); | |
--font-color-lighter: hsl(0, 0%, 40%); | |
--font-color-placeholder: hsl(0, 0%, 70%); | |
--link-color: hsl(203, 82%, 35%); | |
--selection-color: hsl(203, 100%, 74%); | |
--border-color: rgba(0, 0, 0, 0.08); | |
--subtle-border-color: rgba(0, 0, 0, 0.05); | |
--main-background-color: hsl(210, 9%, 98%); |
echo '.env' >> .gitignore | |
git rm -r --cached .env | |
git add .gitignore | |
git commit -m 'untracking .env' | |
git push origin master |
Qwerty | |
,-----------------------------------------------------------------------------------. | |
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | |
|------+------+------+------+------+------+------+------+------+------+------+------| | |
| Tab | Q | W | E | R | T | Y | U | I | O | P | Del | | |
|------+------+------+------+------+-------------+------+------+------+------+------| | |
| Esc | A | S | D | F | G | H | J | K | L | ; | " | | |
|------+------+------+------+------+------|------+------+------+------+------+------| | |
| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | |
|------+------+------+------+------+------+------+------+------+------+------+------| |
var mongoObjectId = function () { | |
var timestamp = (new Date().getTime() / 1000 | 0).toString(16); | |
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() { | |
return (Math.random() * 16 | 0).toString(16); | |
}).toLowerCase(); | |
}; |