投稿時間:2022-03-07 02:11:05 RSSフィード2022-03-07 02:00 分まとめ(12件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
js JavaScriptタグが付けられた新着投稿 - Qiita 【JavaScript】Date オブジェクトのタイムゾーンを差し替えてテストする https://qiita.com/frozenbonito/items/b64c0cf6e3a6b8ff257d paramDatedateフォーマットする日時returnsstringフォーマットされた文字列functionformatTimezonedate何をmockしたらいいか分からないreturndayjsdateformatYYYYMMDDTHHmmssZtimezonemockを使用するtimezonemockはDateオブジェクトをmockに差し替え、ローカルタイムゾーンを自由に変更できるようにするライブラリです。 2022-03-07 01:46:51
海外TECH MakeUseOf 5 Ways to Build an Engaging Presentation in Microsoft PowerPoint https://www.makeuseof.com/tips-for-engaging-powerpoint-presentations/ presentations 2022-03-06 16:46:13
海外TECH MakeUseOf 6 Ways to Fix "The System Cannot Find The Path Specified" Error on Windows https://www.makeuseof.com/windows-system-cannot-find-the-path-specified-error-fix/ Ways to Fix amp quot The System Cannot Find The Path Specified amp quot Error on WindowsIs Windows struggling to find a path even though you re sure it s legitimate It s an annoying issue but there are solutions you can try 2022-03-06 16:16:13
海外TECH MakeUseOf 7 Tips to Get the Best Sound Quality Out of Your Headphones https://www.makeuseof.com/get-best-sound-quality-headphones/ Tips to Get the Best Sound Quality Out of Your HeadphonesNot everyone can afford costly high end headphones but you can use these tips to get the best possible audio quality out of your current pair 2022-03-06 16:16:13
海外TECH DEV Community DockerFile https://dev.to/sundaramawasthi/dockerfile-fe1 DockerFileHey Dev Checkout my new Blog on HOW TO CREATE DOCKER FILE where I discuss about various Intruction of Dockerfile and also do it as Pratical way DockerFile 2022-03-06 16:38:25
海外TECH DEV Community How to create dynamic pages in Gatsby from MDX and YAML? https://dev.to/anuradha9712/how-to-create-dynamic-pages-in-gatsby-from-mdx-and-yaml-37kg How to create dynamic pages in Gatsby from MDX and YAML Gatsby allows you to tie data from many different sources together and present them in a unified way In this article we ll discuss how to set up Node JS and Gatsby to pull the data transform it into usable nodes and auto generate pages based on templates Data from Yaml FileWe can store our data in a YAML file and then it acts as one of our data sources We ll store all our data sources inside the content folder In content records yaml file name Gatsby description Static Site Generator name HTML description Static Website name Node JS description Server side rendering Source PluginWe know gatsby can work with multiple data sources and it can add them all to our graphQL layer however to do this for each source that we use we need to install and register a source plugin and that way gatsby knows how to connect to that data source Source plugins are all registered inside the gatsby config file inside the plugin array plugins also need to be installed into our project using npm so gatsby can find them as well gatsby source filesystem PluginA gatsby source plugin for sourcing data into your gatsby application from your local filesystem Install it using npm install gatsby source filesystem Register them inside the plugins array in the gatsby config js file module exports siteMetadata title Learn Gatsby description step by step guide to learn gatsby author Anuradha Aggarwal lang en plugins resolve gatsby source filesystem options name records path dirname content In the above code snippet we ll provide the path of the directory which contains our yaml file graphQL treats each file as an individual node Now we can check in graphiQL that it will create a separate node in the graphQL layer We can have multiple instances of the filesystem source plugin For every different folder that we have we need a different instance in the gatsby config js file Now let s see how Gatsby transforms this YAML file Transformer PluginsWe want gatsby to know that this file exists and we want you to process it as a YAML file so that we get a JSON object in return we can parse through GraphQL That s done using the gatsby transformer yaml plugin There are transformer plugins present for almost any type of data The transformer plugin takes a data source amp transforms it into something easier to use in our components that we can query in our graphql layer Firstly install transformer plugin for yaml file using npm install gatsby transformer yamlNow in gatsby config js file register this plugin plugins gatsby transformer yaml resolve gatsby source filesystem options name records path dirname content Now in graphiQL we ll have a new type of content which contains nodes related to our yaml file as well Now if you run graphQL query you ll get the exact content that we have stored in our yaml file With the help of this plugin we have full access to the data and we can use it to display on the front end Once gatsby is able to access the data from the YAML file through GraphQL we can work with the data the same way as we have done in the previous post using graphQL queries This is one example to show how gatsby works with the data present in a different format But what if we have data and we want to transform it into a separate page Most common use case of gatsby is blogging platform Now let s see how gatsby works with Markdown files Generate Pages from Markdown FileWe ll follow the following directory structure for the below code gatsby project ┣content ┃┣blog mdx ┣public ┣src ┃┣components ┃┃┣Header js ┃┃┗Layout js ┃┣pages ┃┃┣about js ┃┃┗index js ┃┣styles ┃┗templates ┃┃┗Blog js ┣gatsby config js ┣gatsby node js ┗package json Step Create Markdown fileIn the first step we ll create a markdown file inside the content folder In content blog mdx file create your markdown file title My first blog description This file is to show how to use markdown in the gatsby site What is Lorem Ipsum Lorem Ipsum is simply a dummy text of the printing and typesetting industry Lorem Ipsum has been the industry s standard dummy text ever since the s when an unknown printer took a galley of type and scrambled it to make a type specimen book It has survived not only five centuries but also the leap into electronic typesetting remaining essentially unchanged It was popularized in the s with the release of Leeriest sheets containing Lorem Ipsum passages and more recently with desktop publishing software like Lauds PageMaker including versions of Lorem Ipsum Why do we use it It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout The point of using Lorem Ipsum is that it has a more or less normal distribution of letters as opposed to using Content here content here making it look like readable English Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text and a search for lorem Ipsum will uncover many websites still in their infancy Various versions have evolved over the years sometimes by accident sometimes on purpose injected humor and the like As you notice in the above file we have some data inside triple dashes This data is known as frontmatter 🪄FrontmatterFrontmatter in markdown file represents metadata or extra information about that particular file It is denoted by the triple dashes at the start and end of the block Step Register markdown content using source pluginNow before we ll dynamically pump this data inside our graphQL layer we need to inform gatsby that these markdown files are present here which will act as one of our data sources So to do this we will register them inside the gatsby config js file using the source plugin as we have done before for yaml files module exports plugins resolve gatsby source filesystem options name blogs path dirname content Step Use Transformer plugin for MarkdownTransformer plugins in gatsby take a data source and transform it into something easier to use in our components that we can query in our graphQL layer For the markdown file we ll use the gatsby plugin mdx plugin First install it using npm install gatsby plugin mdx mdx js mdx v mdx js react vRegister it inside gatsby config js file in plugin array module exports plugins gatsby plugin mdx By default only files with the mdx file extension are treated as MDX when using the gatsby source filesystem To use md or other file extensions you can define an array of file extensions in the gatsby plugin mdx section of your gatsby config js gatsby config jsmodule exports plugins resolve gatsby plugin mdx options extensions mdx md defaultLayouts default require resolve src templates Blog js Now when we check on graphiQL it will show our markdown file content embed into the graphQL layer As shown in the above image this plugin comes with the additional feature which gives you the ability to query out tableOfContent or frontmatter for each markdown file which you can further use in your site Step Create a template for MarkdownInside the src folder create a new folder called templates this will store the template required to display the content of our markdown file In src templates Blog js file import MDXRenderer from gatsby plugin mdx import React from react import Layout from components Layout const Blog pageContext gt const blogDescription blogTitle body pageContext return lt div gt lt Layout gt lt h gt blogTitle lt h gt lt p gt blogDescription lt p gt lt br gt lt MDXRenderer gt body lt MDXRenderer gt lt Layout gt lt div gt export default Blog pageContext prop has its special meaning It gives you access to all the required information of your markdown file 🪄pageContextUsing the pageContext props in the template component can come with its performance advantages of getting in all the data you need at build time from the createPages API This removes the need to have a GraphQL query in the template component 🪄MDXRendererMDXRenderer is a React component that takes compiled MDX content and renders it You will need to use this if your MDX content is coming from a GraphQL page query or StaticQuery Step Use gatsby createPage APIWe want gatsby to automatically generate pages for each markdown file via NodeJS To do this we ll use the file called gatsby node js gatsby node js file will run at the build time in a node environment so we can run certain functions inside this file to do things like fetch data amp then generate pages with that data based on a template file that we have created earlier To create a page dynamically we ll use the gatsby createPage API 🪄createPage APICreate pages dynamically This extension point is called only after the initial sourcing and transformation of nodes plus creation of the GraphQL schema are complete so you can query your data in order to create pages In gatsby node js file exports createPages async actions graphql reporter gt const result await graphql query allMdx nodes body slug frontmatter title description if result errors reporter panic failed to create posts result errors const pages result data allMdx nodes The context object is supplied to MDX templates through the pageContext prop pages forEach page gt actions createPage path page slug component require resolve src templates Blog js context pathSlug page slug body page body blogTitle page frontmatter title blogDescription page frontmatter description In the above code snippet first we ll make an graphQL query and use the gatsby createPage API to create new page Inside this we can define component It refers to the template you want to use for your markdown file context this object contains all the data you want to pass to the template as a pageContext prop Now if you navigate to http localhost blog it will show your newly created page from markdown Finally we have created our first dynamic page But there are lot more we can do with the markdown files Let s see more cool features of MDX More about MDX 🪄What is MDX According to Gatsby s Official documentation MDX is a markdown for the component era It lets you write JSX embedded inside markdown It s a great combination because it allows you to use markdown s often terse syntax such as heading for the little things and JSX for more advanced components MDX allows you to use React components alongside Markdown You can also import and reuse your own React components and even other MDX documents In your markdown file title Example to show how to use React Components inside Markdown import CustomHeading from components Headings You can import your own components lt CustomHeading gt This will show my custom heading component lt CustomHeading gt To avoid having to import the same component inside of every MDX document you can add components to an MDXProvider to make them globally available in MDX pages This pattern is sometimes referred to as shortcodes 🪄MDXProviderMDXProvider is a React component that allows you to replace the rendering of tags in MDX content You can also expose any custom component to every mdx file using MDXProviderTo use MDXProvider just make changes in your src components Layout js file import React from react import Header from Header import MDXProvider from mdx js react export default function Layout children const CustomHeading props gt lt h style color green props gt const components h CustomHeading return lt div className layout gt lt Header gt lt div className content gt lt h gt title lt h gt lt p gt description lt p gt lt hr gt content for each page lt MDXProvider components components gt children lt MDXProvider gt lt div gt lt div gt Using this now all the H heading inside the mdx file will be updated with our custom heading component Other Useful ResourcesMDXProviderOther ways to create dynamic PagesGatsby Node APIs Wrap Up That s all for this article Thank you for your time Let s connect to learn and grow together LinkedIn Twitter Instagram 2022-03-06 16:23:44
Apple AppleInsider - Frontpage News New Mac mini & display in 2022, Mac Pro & iMac Pro coming in 2023 says Ming-Chi Kuo https://appleinsider.com/articles/22/03/06/kuo-updated-mac-mini-and-new-display-for-2022-mac-pro-and-imac-pro-in-2023?utm_medium=rss New Mac mini amp display in Mac Pro amp iMac Pro coming in says Ming Chi KuoApple s desktop Mac lineup for may only consist of an updated Mac mini accompanied by a new display analyst Ming Chi Kuo predicts with the rumored Mac Pro and iMac Pro thought to launch in instead Apple is busy preparing for its Peek Performance special event on Tuesday with speculation rife about what Apple could uncover during the presentation If TF Securities analyst Ming Chi Kuo is correct it probably won t include any high performance Macs In a Sunday tweet analyst Kuo offered Predictions for Apple s new desktop products Of the two line prediction s hardware consists of a More powerful Mac mini and more affordable external display Read more 2022-03-06 16:56:04
海外TECH Engadget Amazon offers up to 30 percent off Anker MagGo chargers for today only https://www.engadget.com/amazon-anker-maggo-sale-163257243.html?src=rss Amazon offers up to percent off Anker MagGo chargers for today onlyiPhone and owners take note Amazon has launched a one day Anker sale that includes a handful of products from the company s MagGo line of MagSafe compatible accessories To start you can pick up Anker s magnetic battery in Interstellar Gray Dolomite White and Misty Blue for instead of As far as battery packs go this mAh model has a handful of nifty features It includes a built in foldable kickstand that allows you to stand your iPhone or upright It also comes with a USB C port so you can charge your iPhone without a Lightning cable Buy Anker Magnetic Battery at Amazon Buy Anker Charging Station at Amazon Buy Anker Charging Dock at Amazon Another accessory that s on sale is the wireless charger The Interstellar Gray model is currently priced at down from The is perfect for those who own both a recent iPhone and a pair of AirPods Pro since it can charge both devices simultaneously It also comes with a mAh battery pack that attaches to your iPhone or Anker claims the power cell will extend the battery life of your phone by up to hours The magnet that attaches the two together is strong enough that you can orient the device horizontally and it will stay in place Lastly also on sale is the desktop charging station If you ve read our iPhone accessory guide you know all about this monster of a dock Not only can it wirelessly charge an iPhone but it also comes with two USB A ports two USB C connections and three AC outlets It also looks pretty adorable with its spherical design You can currently pick up the Anker MagGo dock for instead of What s more you don t have to skip the model you most want since all three available colors are included in the sale Follow EngadgetDeals on Twitter for the latest tech deals and buying advice 2022-03-06 16:32:57
ニュース BBC News - Home Protests across Russia see thousands detained https://www.bbc.co.uk/news/world-europe-60640204?at_medium=RSS&at_campaign=KARANGA vladivostok 2022-03-06 16:29:55
ニュース BBC News - Home Ukraine war: Boris Johnson urges renewed world push to halt Russia's invasion https://www.bbc.co.uk/news/uk-60634017?at_medium=RSS&at_campaign=KARANGA ukraine 2022-03-06 16:09:29
ニュース BBC News - Home Arsenal impress but have to cling on to see off Watford https://www.bbc.co.uk/sport/football/60531485?at_medium=RSS&at_campaign=KARANGA watford 2022-03-06 16:10:44
北海道 北海道新聞 スキーW杯複合、渡部暁斗9位 個人第18戦、リーベルV https://www.hokkaido-np.co.jp/article/653615/ 渡部暁斗 2022-03-07 01:04:41

コメント

このブログの人気の投稿

投稿時間: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件)