投稿時間:2023-02-27 02:10:52 RSSフィード2023-02-27 02:00 分まとめ(12件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita SAMを使用してCloudwatchアラームがアラーム状態になったらSlackに通知が行くようなシステムを構築する https://qiita.com/kazu-aws-engineer/items/aa8bc95f4f583950a0b4 serverlessapplicationmod 2023-02-27 01:48:56
python Pythonタグが付けられた新着投稿 - Qiita SAMを使用してCloudwatchアラームがアラーム状態になったらSlackに通知が行くようなシステムを構築する https://qiita.com/kazu-aws-engineer/items/aa8bc95f4f583950a0b4 serverlessapplicationmod 2023-02-27 01:48:56
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScriptフルスクラッチで超簡易ゲームエンジン https://qiita.com/inwan78/items/12bfe2e6cc39fba75125 javascript 2023-02-27 01:52:24
海外TECH MakeUseOf What Is the System Cooling Policy on Windows and How Do You Set It? https://www.makeuseof.com/what-is-the-system-cooling-policy-on-windows-and-how-do-you-set-it/ What Is the System Cooling Policy on Windows and How Do You Set It It s important to keep your PC s processor at a comfortable temperature Fortunately Windows comes with a handy system cooling policy just for this 2023-02-26 16:15:16
海外TECH DEV Community Setting up authentication in Astro with Prisma and Planetscale https://dev.to/thomasledoux1/setting-up-authentication-in-astro-with-prisma-and-planetscale-4g4h Setting up authentication in Astro with Prisma and PlanetscaleI ve been wanting to add authentication to my personal website for a while now to see how it works in Astro With Prisma and PlanetScale already running for comments on my blogs I decided to store my account information in PlanetScale Because it s just used for my own account and I m not storing any other sensitive information in my database I decided to store the credentials in plain text for now I changed my Prisma schema to make this possible schema prismamodel Account id Int id default autoincrement username String unique password String Once the model is updated in the code running npx prisma db push propagates the changes to PlanetScale so the schema is updated in the actual database I used an existing package called astro auth to handle all the authentication on my site For this to work I needed to add environment variables to my application ASTROAUTH URL the URL my site is hosted on and ASTROAUTH SECRET a self chosen secret key Because I stored the credentials in PlanetScale I needed to use the CredentialProvider to enable logging in with username and password There are many other providers available on astro auth go check out the package if you re interested The code needed to set this up with astro auth looks like this pages api auth astroauth tsimport AstroAuth from astro auth core import CredentialProvider from astro auth providers import prisma from lib prisma export const all AstroAuth authProviders CredentialProvider authorize async properties gt const account await prisma account findFirst where username properties username AND password properties password select id true if account id return properties username return null Creating a login page was very easy I just created a form calling the signIn method from astro auth on submit and BOOM logged in The code for the login page pages login astro lt html gt lt head gt lt title gt Login lt title gt lt script gt import signIn from astro auth client document addEventListener DOMContentLoaded gt document querySelector form addEventListener submit async e gt e preventDefault const form e target if form const formData new FormData form as HTMLFormElement const data Object fromEntries formData await signIn provider credential login data window location href lt script gt lt head gt lt body gt lt form gt lt label for username gt Name lt label gt lt input type text name username gt lt label for password gt Password lt label gt lt input type password name password gt lt input type submit value Submit gt lt form gt lt body gt lt html gt After submitting the form the user s signed in and is redirected to the homepage Protecting a page with authentication is easy just checking the logged in user with the getUser function from astro auth Here s an example of a page where I used this check pages comment overview astro import getUser from astro auth core import Layout from layouts Layout astro import prisma from lib prisma import CommentsOverviewWrapper from components CommentOverviewWrapper const user getUser client Astro if user return Astro redirect const commentsWithPost await prisma comment findMany include post select url true lt Layout description Overview of comments title Thomas Ledoux Comment overview gt lt CommentsOverviewWrapper commentsWithPost commentsWithPost client load gt lt Layout gt If the user is not logged in the user will be redirected to the homepage with a status code I also have an API route to delete comments on my blog posts which I want to fence off so only authenticated user can use this API It s possible to use the getUser function from astro auth for this too but this time we re going to pass the request instead of the Astro object Example of using this code pages api comments tsexport const del APIRoute async request gt const user getUser server request if user const body await request json const deleteComment await prisma comment delete where id body id return new Response JSON stringify message Comment with id deleteComment id deleted status return new Response null status So when the user is not authenticated a response will be returned Hope this was helpful Source code can be found on my Github as always 2023-02-26 16:22:26
Apple AppleInsider - Frontpage News Apple's AR headset probably won't need an iPhone to function https://appleinsider.com/articles/23/02/26/apples-ar-headset-probably-wont-need-an-iphone-to-function?utm_medium=rss Apple x s AR headset probably won x t need an iPhone to functionApple s highly anticipated mixed reality headset may not require an iPhone to work with the first release in the lineup likely to be able to work independently of any other Apple device A render of a potential Apple headset AppleInsider Apple is thought to be preparing its initial ar headset is expected to finally surface in potentially during or before WWDC The first headset in Apple s product line that could appear at that time may be more of a standalone device than previously thought with it apparently able to work without the user necessarily having an iPhone or iPad beforehand Read more 2023-02-26 16:05:07
海外TECH Engadget The Xiaomi 13 Pro with Leica cameras is coming to Europe https://www.engadget.com/the-xiaomi-13-pro-with-leica-cameras-is-coming-to-europe-163557200.html?src=rss The Xiaomi Pro with Leica cameras is coming to EuropeIt s been a long time coming but Xiaomi is finally bringing its Leica endorsed smartphones to the international market Following their China launch back in December the Xiaomi and Pro are going global at MWC with Germany France Spain and Italy being some of their first markets in the west As you d expect both Snapdragon Gen flagships now come with Google services pre installed but they are otherwise identical to their China counterparts The Xiaomi and Pro share similar looking Leica camera islands on the back but only the Pro offers the much hyped Type inch sensor Sony s IMX um pixel size ーarguably the industry s most powerful camera sensor at the moment ーfor its megapixel f OIS optical image stabilization main shooter You also get a megapixel x telephoto camera mm equivalent with OIS and a megapixel f ultra wide camera mm equivalent As for the lesser Xiaomi it comes with a megapixel f OIS main camera with a smaller sensor IMX um pixel size a megapixel x zoom OIS zoom camera and a megapixel ultra wide mm equivalent camera Both models share the same megapixel f punch hole selfie cam on the other side On a similar note both phones offer two modes of capture ーLeica Authentic and Leica Vibrant ーalong with Google s Magic Eraser tool Xiaomi Pro and XiaomiThe Xiaomi series also comes in two designs The Pro comes with a curved inch x AMOLED screen with vegan leather or ceramic back versions On the other hand the packs a flat inch x AMOLED display which is surrounded by iPhone like aluminum sides and complemented by either glass or leather back options Both screens support a refresh rate of up to Hz for a slick scrolling experience Other noteworthy features include the Pro s W charging from zero to percent in just minutes for its mAh battery the s W charging minutes to fully charge its mAh cell and W wireless charging Dolby Atmos dual speakers and IP ruggedness for both Android devices The Pro starts from euros around whereas the starts from euros around XiaomiAs a surprise for MWC Xiaomi also announced the Lite which appears to be a variant of the selfie centric Civi sold in China And no there s no Leica involvement here This model starts from euros around and boasts dual front cameras megapixel megapixel depth sensor plus dual quot Selfie Glow quot LEDs for supposedly better selfies It s powered by a Snapdragon Gen processor and it also packs a megapixel main camera IMX a megapixel ultra wide camera a megapixel macro camera a mAh battery with W charging and a inch Full HD Hz display This is all tucked into a g heavy mm thick body which obviously goes well with its quot Lite quot branding 2023-02-26 16:35:57
ニュース @日本経済新聞 電子版 米高官、ロシアに武器供与なら中国制裁 欧州と断念迫る https://t.co/cZaRQQsNHv https://twitter.com/nikkei/statuses/1629879943696986117 高官 2023-02-26 16:23:54
ニュース BBC News - Home Northern Ireland Protocol: Announcement about Brexit deal imminent https://www.bbc.co.uk/news/uk-64778848?at_medium=RSS&at_campaign=KARANGA commission 2023-02-26 16:54:15
ニュース BBC News - Home Women's T20 World Cup: Australia beat spirited South Africa by 19 runs to win sixth title https://www.bbc.co.uk/sport/cricket/64770116?at_medium=RSS&at_campaign=KARANGA successive 2023-02-26 16:53:16
ニュース BBC News - Home Tottenham Hotspur 2-0 Chelsea: Harry Kane goal seals win for hosts https://www.bbc.co.uk/sport/football/64693818?at_medium=RSS&at_campaign=KARANGA Tottenham Hotspur Chelsea Harry Kane goal seals win for hostsTottenham boost their hopes of top four Premier League finish with a win over Chelsea that increases the pressure on Blues boss Graham Potter 2023-02-26 16:45:45
ニュース BBC News - Home Chelsea 2-0 Arsenal: Kerr scores in 100th game as Blues progress in Women's FA Cup https://www.bbc.co.uk/sport/football/64757696?at_medium=RSS&at_campaign=KARANGA Chelsea Arsenal Kerr scores in th game as Blues progress in Women x s FA CupSam Kerr scored her nd goal in Chelsea appearances as the Blues beat Arsenal at Kingsmeadow to reach the quarter finals of the Women s FA Cup 2023-02-26 16:29:31

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)