From 3ba289e1b1be057d8ab40cc4fd6144ba61ac1892 Mon Sep 17 00:00:00 2001 From: Kevin Kandlbinder Date: Sun, 13 Feb 2022 18:34:38 +0000 Subject: [PATCH] Run prettier --- content/blog/general/001-free-pizza.mdx | 32 +++++++-- content/blog/scambox/002-crypto-ideas.mdx | 77 ++++++++++---------- src/components/languageSwitcher.tsx | 4 +- src/components/navigation.tsx | 4 +- src/components/offscreenNav.tsx | 6 +- src/components/scambox/Chatblah.tsx | 86 +++++++++++++---------- src/components/scambox/Chatbox.tsx | 43 +++++++++--- src/components/scambox/Chatmsg.tsx | 45 +++++++----- src/components/scambox/Chatnotice.tsx | 14 ++-- src/components/seo.tsx | 21 ++++-- src/layouts/default.tsx | 29 +++++--- src/pages/donate.tsx | 68 +++++++++--------- src/pages/social.tsx | 3 +- src/templates/blog/listing.tsx | 7 +- src/templates/blog/post.tsx | 2 +- 15 files changed, 266 insertions(+), 175 deletions(-) diff --git a/content/blog/general/001-free-pizza.mdx b/content/blog/general/001-free-pizza.mdx index b950764..5af0449 100644 --- a/content/blog/general/001-free-pizza.mdx +++ b/content/blog/general/001-free-pizza.mdx @@ -8,10 +8,10 @@ published: 2018-03-10 22:00:00 author: name: Kevin Kandlbinder embeddedImagesLocal: - - './assets/001-free-pizza/firefox_2018-03-10_11-51-08-e1520680515546.png' + - "./assets/001-free-pizza/firefox_2018-03-10_11-51-08-e1520680515546.png" --- -import { getImage, GatsbyImage } from 'gatsby-plugin-image'; +import { getImage, GatsbyImage } from "gatsby-plugin-image"; > „Never trust user input“ @@ -32,8 +32,9 @@ Nachdem ich das sah war die Challenge nicht mehr zu ignorieren: ICH WILL GEWINNE Also habe ich mich durch den Code gewühlt und mir fielen mehrere Variablen auf, die offensichtlich für die Gewinnchancen zuständig sind. (Fun Fact: Die Chance beim ersten Versuch ist größer als bei allen weiteren) Als ich aber mit denen ein bisschen ohne Ergebnis rumgespielt habe, habe ich mich direkt in die Funktionen gesetzt und nachvollzogen was das Programm genau macht wenn ich den Button drücke, und da war es: In Zeile 203 fand sich die Funktion „win“… +
- +
Aber das kann doch nicht funktionieren… Die Web-Sicherheit… @@ -43,11 +44,19 @@ Aber das kann doch nicht funktionieren… Die Web-Sicherheit… Also nichts wie ab damit in die Konsole und…
- Konsole - Casino + Konsole + Casino
-…gewonnen, der Code war besiegt, die Challenge gemeistert, die Web-Sicherheit im A**** und ich zufrieden. Toll. Aber was nun? Sich ganz viele Gutscheine auf Prepaid-Nummern holen? Zu anstrengend. Pizza.de Bescheid sagen? Ja, aber nicht genug… Darüber schreiben und eine Moral für jeden Entwickler draus ziehen? Ja, das klingt gut! +…gewonnen, der Code war besiegt, die Challenge gemeistert, die Web-Sicherheit im A\*\*\*\* und ich zufrieden. Toll. Aber was nun? Sich ganz viele Gutscheine auf Prepaid-Nummern holen? Zu anstrengend. Pizza.de Bescheid sagen? Ja, aber nicht genug… Darüber schreiben und eine Moral für jeden Entwickler draus ziehen? Ja, das klingt gut! ## Die Moral von der Geschicht‘... @@ -55,4 +64,13 @@ Also nichts wie ab damit in die Konsole und… Das Casino sollte im Hintergrund seine Ergebnisse auf dem Server generieren, auch wenn es eine kurze Ladezeit gäbe und vom Server einen Token bekommen, mit dem der Gewinn abgeholt werden könnte. Somit würde der Server entscheiden ob ein Gutschein herausgegeben wird und nicht ein hobbyloser Typ mit einem PC. -Importiert aus altem Blog - Archiviertes Original + + Importiert aus altem Blog -{" "} + + Archiviertes Original + + diff --git a/content/blog/scambox/002-crypto-ideas.mdx b/content/blog/scambox/002-crypto-ideas.mdx index fe035e8..ae3988e 100644 --- a/content/blog/scambox/002-crypto-ideas.mdx +++ b/content/blog/scambox/002-crypto-ideas.mdx @@ -19,21 +19,17 @@ Today I want to tell you the story of a business investor, amazing ideas, unregu So put on your seatbelts, grab your popcorn, we're jumping right into the chat-log! - - Hello - + Hello Hi - - How's it going? - + How's it going? Can't complain, how about you? -I love when scammers do small talk. You can always notice how forced and fake it feels. +I love when scammers do small talk. You can always notice how forced and fake it feels. Wasting time here is the most fun, because they just want to get to their scammy part, but have to warm you up first. @@ -48,81 +44,84 @@ Wasting time here is the most fun, because they just want to get to their scammy It's not immoral to lie to a scammer... right? - - Where does your family live? - + Where does your family live? Just south of Philly - I work at the coca cola company, but I'm also investing in crypto. What about you? + I work at the coca cola company, but I'm also investing in crypto. What + about you? I do not work at the coca cola company. - - Where do you work? - + Where do you work? I work at a nightclub as a barkeeper - - Do you make good money with that? - + Do you make good money with that? Can't complain, I recently inherited a huge sum of money - - Have you thought about any business? - + Have you thought about any business? -Oh Megan, you would not *believe* just how many amazing business ideas I have... +Oh Megan, you would not _believe_ just how many amazing business ideas I have... Ok, hear me out... -
+
Vapes, but cats and dogs can use them!
- - That sounds like a great idea. - + That sounds like a great idea.
No it absolutely does not, but she can't say that because she still wants me to invest in her crypto scam. 🙂 - - Have you ever thought about crypto? - + Have you ever thought about crypto? Actually I have. That is another business idea of mine -
- Organs, but they're NFTs! Right now there's the legal donation system, illegal black markets, everything is not very transparent. - Now imagine every organ was an NFT!

+
+ Organs, but they're NFTs! Right now there's the legal donation system, + illegal black markets, everything is not very transparent. Now imagine + every organ was an NFT! +
+
Democratizing the Organ market one transaction at a time.
-At this point Megan was ready to launch into her whole crypto spiel, and I just kinda tuned out. +At this point Megan was ready to launch into her whole crypto spiel, and I just kinda tuned out. But appearently my idea would work perfectly with her investment opportunity! - crypto investment and I love NFTs looking into minting some. and your NFTs could work with that! with my investment company based in Denmark! + + + + crypto investment + + and I love NFTs looking into minting some. + + + and your NFTs could work with that! + + + + with my investment company based in Denmark! - Denmark? That's really close to where I live. Where exactly is the company, so I can go there and give them the money directly? - - - What do you mean? There is no need to travel + Denmark? That's really close to where I live. Where exactly is the + company, so I can go there and give them the money directly? + What do you mean? There is no need to travel - Oh it's no problem. It's really not far, and we can save on transaction fees if I bring the money directly! + Oh it's no problem. It's really not far, and we can save on transaction + fees if I bring the money directly! Megan has cleared the chat Weird... Looks like Megan did not want me to visit her amazing investment company in Denmark... 😢 - diff --git a/src/components/languageSwitcher.tsx b/src/components/languageSwitcher.tsx index 4c6820a..cdd46d3 100644 --- a/src/components/languageSwitcher.tsx +++ b/src/components/languageSwitcher.tsx @@ -32,6 +32,6 @@ const LanguageSwitcher = () => { ); -} +}; -export default LanguageSwitcher +export default LanguageSwitcher; diff --git a/src/components/navigation.tsx b/src/components/navigation.tsx index 490ecb2..6bbdfc1 100644 --- a/src/components/navigation.tsx +++ b/src/components/navigation.tsx @@ -9,8 +9,8 @@ import OffScreenNav from "./offscreenNav"; import useSiteMetadata from "../helpers/useSiteMetadata"; type NavigationProps = { - isHome?: boolean -} + isHome?: boolean; +}; const Navigation = ({ isHome }: NavigationProps) => { let [atTop, setAtTop] = useState(false); diff --git a/src/components/offscreenNav.tsx b/src/components/offscreenNav.tsx index ceabdf6..e2a26dc 100644 --- a/src/components/offscreenNav.tsx +++ b/src/components/offscreenNav.tsx @@ -8,9 +8,9 @@ import { X } from "lucide-react"; import useSiteMetadata from "../helpers/useSiteMetadata"; type OffScreenNavProps = { - active: boolean, - close: () => void -} + active: boolean; + close: () => void; +}; const OffScreenNav = ({ active, close }: OffScreenNavProps) => { const { t } = useTranslation(); diff --git a/src/components/scambox/Chatblah.tsx b/src/components/scambox/Chatblah.tsx index 9d09675..43a68d5 100644 --- a/src/components/scambox/Chatblah.tsx +++ b/src/components/scambox/Chatblah.tsx @@ -1,58 +1,72 @@ import React, { useEffect, useRef, useState } from "react"; import anime, { AnimeTimelineInstance } from "animejs"; -import _uniqueId from 'lodash/uniqueId'; -import {useMediaQuery} from '@react-hook/media-query' - +import _uniqueId from "lodash/uniqueId"; +import { useMediaQuery } from "@react-hook/media-query"; import * as styles from "./Chatbox.module.scss"; const Chatblah = () => { - const animeRef = useRef(null) - const [myId,] = useState(_uniqueId) - const reduceMotion = useMediaQuery("(prefers-reduced-motion: reduce)") + const animeRef = useRef(null); + const [myId] = useState(_uniqueId); + const reduceMotion = useMediaQuery("(prefers-reduced-motion: reduce)"); useEffect(() => { - if(typeof window === "undefined") return; // Don't run on static build - if(reduceMotion) return; // Don't run the animation for users who prefer reduced motion + if (typeof window === "undefined") return; // Don't run on static build + if (reduceMotion) return; // Don't run the animation for users who prefer reduced motion const speed = 0.25; - const delay = anime.random(100/speed, 1000/speed); + const delay = anime.random(100 / speed, 1000 / speed); animeRef.current = anime.timeline({ - targets: "#chatblah-"+myId, + targets: "#chatblah-" + myId, loop: true, - easing: "easeInOutSine" - }) + easing: "easeInOutSine", + }); - const tl = animeRef.current + const tl = animeRef.current; - tl.add({ - duration: 250/speed, - opacity: [0, .25], - easing: "linear" - }, delay).add({ - duration: 1000/speed, - rotate: [anime.random(-5, 5)+"deg", anime.random(-10, 10)+"deg"], - translateY: [0, anime.random(0, -2)+"px"], - translateX: [0, anime.random(-2, 2)+"px"], - }, delay).add({ - duration: 500/speed, - opacity: [.25, 0], - easing: "linear" - }, delay+(500/speed)) + tl.add( + { + duration: 250 / speed, + opacity: [0, 0.25], + easing: "linear", + }, + delay + ) + .add( + { + duration: 1000 / speed, + rotate: [ + anime.random(-5, 5) + "deg", + anime.random(-10, 10) + "deg", + ], + translateY: [0, anime.random(0, -2) + "px"], + translateX: [0, anime.random(-2, 2) + "px"], + }, + delay + ) + .add( + { + duration: 500 / speed, + opacity: [0.25, 0], + easing: "linear", + }, + delay + 500 / speed + ); return () => { - if(animeRef.current) { + if (animeRef.current) { animeRef.current.pause(); animeRef.current = null; } - } - }, [myId, reduceMotion]) + }; + }, [myId, reduceMotion]); + return ( +
+ blah +
+ ); +}; - return
- blah -
-} - -export default Chatblah \ No newline at end of file +export default Chatblah; diff --git a/src/components/scambox/Chatbox.tsx b/src/components/scambox/Chatbox.tsx index 665bc6b..98d4d16 100644 --- a/src/components/scambox/Chatbox.tsx +++ b/src/components/scambox/Chatbox.tsx @@ -4,17 +4,38 @@ import { useTranslation } from "react-i18next"; import * as styles from "./Chatbox.module.scss"; type ChatboxProps = { - open?: string -} + open?: string; +}; -const Chatbox = ({children, open}: React.PropsWithChildren) => { - const {t} = useTranslation(); +const Chatbox = ({ children, open }: React.PropsWithChildren) => { + const { t } = useTranslation(); - return
- -- {open === "top" || open === "both" ? t("blog.scambox.chatbox.resume") : t("blog.scambox.chatbox.begin")} -- - {children} - -- {open === "bottom" || open === "both" ? t("blog.scambox.chatbox.interrupt") : t("blog.scambox.chatbox.end")} -- -
-} + return ( +
+ + --{" "} + {open === "top" || open === "both" + ? t("blog.scambox.chatbox.resume") + : t("blog.scambox.chatbox.begin")}{" "} + -- + + {children} + + --{" "} + {open === "bottom" || open === "both" + ? t("blog.scambox.chatbox.interrupt") + : t("blog.scambox.chatbox.end")}{" "} + -- + +
+ ); +}; -export default Chatbox \ No newline at end of file +export default Chatbox; diff --git a/src/components/scambox/Chatmsg.tsx b/src/components/scambox/Chatmsg.tsx index b367502..e64a118 100644 --- a/src/components/scambox/Chatmsg.tsx +++ b/src/components/scambox/Chatmsg.tsx @@ -1,27 +1,40 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import * as styles from "./Chatbox.module.scss" +import * as styles from "./Chatbox.module.scss"; type ChatmsgProps = { - name?: string, - timestamp?: string, - color?: string, - dir: string -} + name?: string; + timestamp?: string; + color?: string; + dir: string; +}; const Chatmsg = (props: React.PropsWithChildren) => { - const {t} = useTranslation(); + const { t } = useTranslation(); - return
- {props.name && {props.name} {t("blog.scambox.chatbox.says")}} -
-
- {props.children} + return ( +
+ {props.name && ( + + {props.name} + + {" "} + {t("blog.scambox.chatbox.says")} + + + )} +
+
{props.children}
+ {props.timestamp && {props.timestamp}}
- {props.timestamp && {props.timestamp}}
-
-} + ); +}; -export default Chatmsg \ No newline at end of file +export default Chatmsg; diff --git a/src/components/scambox/Chatnotice.tsx b/src/components/scambox/Chatnotice.tsx index 901b692..b257928 100644 --- a/src/components/scambox/Chatnotice.tsx +++ b/src/components/scambox/Chatnotice.tsx @@ -1,11 +1,13 @@ import React from "react"; -import * as styles from "./Chatbox.module.scss" +import * as styles from "./Chatbox.module.scss"; const Chatnotice = (props: React.PropsWithChildren<{}>) => { - return
- {props.children} -
-} + return ( +
+ {props.children} +
+ ); +}; -export default Chatnotice \ No newline at end of file +export default Chatnotice; diff --git a/src/components/seo.tsx b/src/components/seo.tsx index ae97d0a..0558e30 100644 --- a/src/components/seo.tsx +++ b/src/components/seo.tsx @@ -6,14 +6,21 @@ import { useTranslation } from "gatsby-plugin-react-i18next"; import useSiteMetadata from "../helpers/useSiteMetadata"; type SEOProps = { - description?: string, - meta?: any[], - title: string, - speakable?: any, - image?: string -} + description?: string; + meta?: any[]; + title: string; + speakable?: any; + image?: string; +}; -function SEO({ description, meta, title, speakable, image, children }: React.PropsWithChildren) { +function SEO({ + description, + meta, + title, + speakable, + image, + children, +}: React.PropsWithChildren) { const { t } = useTranslation(); const { site } = useStaticQuery( graphql` diff --git a/src/layouts/default.tsx b/src/layouts/default.tsx index eb16c0a..7a7281b 100644 --- a/src/layouts/default.tsx +++ b/src/layouts/default.tsx @@ -6,16 +6,25 @@ import { Link, Trans } from "gatsby-plugin-react-i18next"; import LanguageSwitcher from "../components/languageSwitcher"; type LayoutProps = { - description?: string, - meta?: any[], - title: string, - transparentTopbar?: boolean, - seoAdditional?: any, - image?: string, - speakable?: any -} + description?: string; + meta?: any[]; + title: string; + transparentTopbar?: boolean; + seoAdditional?: any; + image?: string; + speakable?: any; +}; -const Layout = ({description, meta, title, image, speakable, seoAdditional, transparentTopbar, children}: React.PropsWithChildren) => { +const Layout = ({ + description, + meta, + title, + image, + speakable, + seoAdditional, + transparentTopbar, + children, +}: React.PropsWithChildren) => { return ( <> ); -} +}; Layout.defaultProps = { module: `none`, diff --git a/src/pages/donate.tsx b/src/pages/donate.tsx index 9a7d0a5..ebf601d 100644 --- a/src/pages/donate.tsx +++ b/src/pages/donate.tsx @@ -100,39 +100,41 @@ const DonatePage = (props) => { />
- socialDescriptionWithLink + socialDescriptionWith + Link

diff --git a/src/templates/blog/listing.tsx b/src/templates/blog/listing.tsx index 6ce05da..3153ae4 100644 --- a/src/templates/blog/listing.tsx +++ b/src/templates/blog/listing.tsx @@ -43,7 +43,12 @@ const BlogListing = ({ data, pageContext }) => { >
- +
{t("blog.section.scambox.name")} diff --git a/src/templates/blog/post.tsx b/src/templates/blog/post.tsx index 0191a69..2ae5118 100644 --- a/src/templates/blog/post.tsx +++ b/src/templates/blog/post.tsx @@ -30,7 +30,7 @@ const BlogPost = ({ data }) => { { "@type": "Person", name: data.mdx.frontmatter.author.name, - url: "https://kevink.dev/blog/" + url: "https://kevink.dev/blog/", }, ], })}