Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tttimur
tttimur / index.js
Last active June 10, 2020 16:28
Prismic and next's demo
import { getPage } from '../api/prismic'
import Homempage from '../components/Homepage'
const Index = ({ page }) => <Homepage {...page} />
// to generate props during build time,
// can be replaced with getServerSideProps
Index.getStaticProps = async () => {
const page = await getPage('support')
@tttimur
tttimur / html.html
Last active October 21, 2020 19:43
Marquee!
<style lang="scss">
.carousel {
width: 100vw;
overflow: hidden;
.carousel-animation {
width: 50000px;
overflow: visible;
{
id: 7454,
created_at: "2015-06-01T19:57:42.751Z",
slug: "timur-fattahov",
username: "Timur Fattahov",
first_name: "Timur",
last_name: "Fattahov",
full_name: "Timur Fattahov",
avatar: "https://arena-avatars.s3.amazonaws.com/7454/small_053aace3b95000570b920a8cba8dcf6b.jpg?1544505138",
avatar_image: {
@tttimur
tttimur / image-optim.sh
Last active May 21, 2021 15:33
Image optimization with mozjpeg and webp
# this is not a bash file to execute, but run the following commands in your terminal
# requirements (install instructions at bottom of page)
# imagemin-cli, imagemin-mozjpeg, imagemin-pngquant, imagemin-webp, imagemagick (mogrify)
--------------------------------------------------------------
# 1. create the appropriate directories
$ mkdir build large large-webp small small-webp
# 2. mozjpeg compression of fullsize images
$ imagemin *.jpg --out-dir=build --plugin=mozjpeg && imagemin *.png --out-dir=build --plugin=pngquant
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.