Snippets

A collection of code snippets I often use. Imported from the GitHub Gists REST API.

is_prime.py

Check if a number is prime

Visit

prime_factors.py

Find the prime factors of the number given

Visit

fib_seq.py

Generate the Fibonacci sequence for the length given

Visit

pascal_tri.py

Generate Pascal's triangle for the number of rows given

Visit

db-relationships.md

Relationships and foreign keys in SQL databases

Visit

full-page-bg-img.css

CSS Full-page background image

Visit

flex-rows.css

CSS Flexbox with specified number of boxes in rows

Visit

npm-downloads-api.md

npm REST API endpoint for package downloads

Visit

comma-thousands-separator.js

Add comma thousands separator: https://stackoverflow.com/a/2901298

Visit

fetch-api.js

JavaScript fetch() API: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

Visit

center-items-flexbox.css

Center items using CSS flexbox

Visit

link-new-tab.html

HTML Hyperlink that opens in new tab

Visit

link-bottom-border.css

CSS Bottom-border for links

Visit

custom-text-selection.css

Custom text selection appearance

Visit

custom-scrollbar.css

CSS Custom scrollbar

Visit

darken-background-image.css

Darken background image: https://stackoverflow.com/a/23208450

Visit

header-blurred-background.css

Blur background of a header: https://stackoverflow.com/a/64606048

Visit

get-youtube-videos.js

Get YouTube videos of a channel

Visit

get-github-gists.js

Get all GitHub Gists of a user

Visit

404.js

Next.js Custom 404 page

Visit

screen-media-queries.css

CSS screen media queries

Visit

react-useeffect.md

React useEffect cheat sheet

Visit