投稿時間:2022-08-22 03:13:20 RSSフィード2022-08-22 03:00 分まとめ(15件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
js JavaScriptタグが付けられた新着投稿 - Qiita ajaxでリクエストしたレスポンスをもとにエラーメッセージを表示する仕組みを簡単に一枚図で説明する https://qiita.com/Ponko_twoo/items/b53dbc7ad64b62f7e718 説明 2022-08-22 02:17:46
js JavaScriptタグが付けられた新着投稿 - Qiita deno deployで「ReferenceError: h is not defined」が出たときの対処法 https://qiita.com/access3151fq/items/d6026e656844abfae922 denodeploy 2022-08-22 02:11:54
海外TECH DEV Community Styling React App - Stylify vs Styled Components https://dev.to/machy8/styling-react-app-stylify-vs-styled-components-5bd5 Styling React App Stylify vs Styled ComponentsStylify generates utility first CSS based on what you write It works with any framework and with any tool Styled Components is a library for styling React components This article is not about which tool is better but about comparing approaches when styling the app with these tools SetupFor all the examples below I am going to use the vite react setup Stylify requires the installation and a bit of configuration It s because the CSS is generated during a build before the app is initialized npm i D stylify unpluginAnd the vite config js const stylifyPlugin vitePlugin transformIncludeFilter id gt return id endsWith js id endsWith jsx bundles outputFile src stylify css files src js src jsx extend bundler compiler selectorsAreas s className s className s className n export default defineConfig plugins stylifyPlugin react You can try to edit the Stylify Vite React and Stylify Next examples on Stackblitz Styled Components only requires to install the library and it can be used right away npm i styled components Syntax and usageWhen you want to style an element with the Styled Components you can use the CSS API or create a component const Title styled div color blue font weight bold lt Title gt Hello World lt Title gt The generated CSS looks like this sc bdVaJa knKEua color blue font weight bold Stylify on the other hand takes file content and generates CSS for each matched selector Each selector is by default a utility and is generated only once The syntax is by default native CSS property value Also when writing values you can use two underscores instead of space and a hat for a quote It is similar to Tailwind but without having to learn and remember the custom selectors and shortcuts If you know CSS you already know the Stylify selectors In case you need want shorter or custom selectors you can add your own macros The selectors can be written right away without defining a component lt div className color blue font weight bold gt Hello World lt div gt CSS output color blue color blue font weight bold font weight bold However nobody wants bloated templates with utilities Sometimes the components are necessary They can be defined globally in a config or locally in a file through content options where they are used In the file it expects a javascript object without the surrounding brackets The definition is recommended within comments because almost any file format can handle comments In Stylify the component is a CSS class and it can be used on any element stylify components title color blue font weight bold stylify components lt div className title gt Hello World lt div gt The title selector in the CSS is attached to each selector it requires Because of that there are fewer selectors duplicates and the CSS is smaller color blue title color blue font weight bold title font weight bold When it comes to production the selectors can be minified lt div class io gt Hello World lt div gt asder io color blue afv io font weight bold Media queriesWhen we need a different style for various media queries we can do that like this in Styled Components const Title styled div color blue media max width px color red With Stylify you can use predefined screens or dynamic ones stylify components title color blue md color red minwpx color orange stylify components lt div className title gt Hello World lt div gt VariablesVariables can be used within the Styled Components directly in the styles const Title styled div color props gt props color red Stylify allows you to define variables and then use them within the selectors stylify variables blue EB red b stylify variablesstylify components title color blue stylify components lt div className color red gt lt div gt When there is a case that we need various types of one button we need to write the full selectors in stylify lt div className wrapper searchDiv isOrangeButton color orange color blue gt lt div gt KeyframesThe keyframes in the Styled Components can be defined like this const rotate keyframes from transform rotate deg to transform rotate deg const Rotate styled div animation rotate s linear infinite In Stylify it looks a bit different stylify keyframes rotate from transform rotate deg to transform rotate deg stylify keyframes lt div class animation rotate s linear infinite gt lt div gt A simple animation example Plain selectorsWhen it comes to global styles and simple selectors they can be defined within the Styled Components using createGlobalStyle import createGlobalStyle from styled components const GlobalStyle createGlobalStyle button color red lt React Fragment gt lt GlobalStyle gt lt React Fragment gt In Stylify the same thing is achieved using plain selectors The selectors are directly injected into the generated CSS file stylify plainSelectors button color red stylify plainSelectors lt button gt lt button gt Splitting CSSThe Styled Components doe s a good job when it comes to optimization as it automatically splits the CSS into critical and noncritical and injects the CSS of those components that are used However the compilation is done when the app is running Stylify doesn t work that way It generates CSS files according to your configuration and you have to tell the app when the CSS should be loaded You can configure a bundle for each page component layout separately Even though you can split the CSS however you want thanks to the utilities components combination the CSS size is going to be relatively small as the selectors are generated only once So sometimes it makes sense to have only Front Admin CSS Stylify website has less then Kb and other websites are between Kb One more feature is that it doesn t slow down the app because the CSS is generated before the app is initialized Let me know what you think I will be happy for any feedback The Stylify is still a new Library and there is a lot of space for improvement Also a big thanks goes to Luke Shiru for reviewing the information about the Styled Components Stay in touch stylifycssstylifycss com machydev to machymedium com machy 2022-08-21 17:50:40
海外TECH DEV Community Making a Morphing 3D Sphere in Javascript with Three.js https://dev.to/smpnjn/making-a-morphing-3d-sphere-in-javascript-with-threejs-13oi Making a Morphing D Sphere in Javascript with Three jsI love d effects on the internet and they re increasingly all over the place They can add an extra dimension to a website that helps to catch a user s attention I have previously covered d effects with the WebGL cards I made but in this guide I wanted to create a morphing sphere with a cool wireframe background Through this tutorial I ll also help you understand the basics of how d effects work on the web Let s get started Here is the demo Creating a D Morphing SphereThe tool I use for accessing WebGL functionality in the browser is called three js It s a package that simplifies the process of doing d work in the browser and to do this it uses canvas We ll append this through code later It s important to understand that three js simply gives us an interface to work with WebGL which is an API for rendering d and d objects on the web that s why we ll import three js next You can do this through npm The two things we re going to want to install here are as follows npm i threenpm i open simplex noisenpm install three orbitcontrolsImport these into your code once they re installed Since I did my demo on codepen I imported them using skypack These three functions will let us do three pun not intended things use d shapes on the web three control the camera three orbitcontrols create noise and randomness open simplex noise import as THREE from import OrbitControls from examples jsm controls OrbitControls js import openSimplexNoise from Setting up our scene for d objects in three jsAfter we ve imported our packages we want to do a few things create a new scene for our d objects to sit oncreate a camera so we can look at our scenecreate a renderer and set its size so we don t get weird fuzzy shapesadd in our orbital controls so we can click and drag our object and move it around Scenelet scene new THREE Scene Cameralet camera new THREE PerspectiveCamera innerWidth innerHeight camera position set Rendererlet renderer new THREE WebGLRenderer antialias true alpha true renderer setSize innerWidth innerHeight Append our renderer to the webpage Basically this appends the canvas to our webpage document body appendChild renderer domElement new OrbitControls camera renderer domElement Now the fun can begin and we can start adding in our d shapes Adding d shapes to our scene with three jsFirst up is our sphere Each object in three js consists of two parts the geometry which is the vertices and triangles that make up the sphere and the mesh which is the colors patterns and features of those vertices Since we want to manipulate all of our vertices ultimately I am going to store them all separately in a positionData array too We will use the bult in Vector function to store sets of d coordinates in three js Create our geometrylet sphereGeometry new THREE SphereGeometry This section is about accessing our geometry vertices and their locationssphereGeometry positionData let v new THREE Vector for let i i lt sphereGeometry attributes position count i v fromBufferAttribute sphereGeometry attributes position i sphereGeometry positionData push v clone A normal material uses the coordinates of an object to calculate its colorlet sphereMesh new THREE MeshNormalMaterial Combine both and add it to the scene let sphere new THREE Mesh sphereGeometry sphereMesh scene add sphere Using Custom Shaders InsteadNow one caveat here I decided to make my sphere a little more customizable and to do that I used shaders So when we call MeshNormalMaterial it actually does something a bit unusual for the web It uses something called shaders to calculate the color of each vertices There are two types of shaders fragment which is essentially the colors of the object and vertex which is the position of the vertices on that shape These shaders are written in GLSL or OpenGL Shading Language so not Javascript I m not going to go into detail about how this language works but it s a little bit more like C than Javascript The fundamentals are Instead of using MeshNormalMaterial we can use ShaderMaterial and build our own shaders We will use Normal Material shaders so the same effect will occur but having them in our code means we can update it later for example change the colors We can pass Javascript variables into the shader in real time using uniforms which are a special type of variable in GLSL That means we define our GLSL in the HTML and pull it in with a Javascript selector Note I haven t made any real changes to these shaders compared to MeshNormalMaterial the only difference is I am passing in a color as a uniform That means we can change this value from Javascript if we want I ll only show the fragment shader here but both can be found in the HTML section on codepen Notice that I define uniform vec colorA that s the variable we will be using from our Javascript Ultimately shaders make a manipulation for every pixel of our D object based what we tell them to do They are computationally expensive but can create some pretty cool effects lt script id fragment type text glsl gt uniform vec colorA define NORMAL if defined FLAT SHADED defined USE BUMPMAP defined TANGENTSPACE NORMALMAP varying vec vViewPosition endif include lt packing gt include lt uv pars fragment gt include lt normal pars fragment gt include lt bumpmap pars fragment gt include lt normalmap pars fragment gt include lt logdepthbuf pars fragment gt include lt clipping planes pars fragment gt void main include lt clipping planes fragment gt include lt logdepthbuf fragment gt include lt normal fragment begin gt include lt normal fragment maps gt gl FragColor vec normalize normal colorA ifdef OPAQUE gl FragColor a endif lt script gt How normal shaders workA normal shader calculates the color of a pixel by the calculation normalize normal As such we can swap out the first for a custom color that being our uniform colorA We can then add both of these vertex and fragment shader to our Javascript like so let sphereMesh new THREE ShaderMaterial uniforms colorA type vec value new THREE Vector vertexShader document getElementById vertex textContent fragmentShader document getElementById fragment textContent It s important when learning WebGL to know that this is how it works under the hood Shaders are really important to doing things in d so it s good to know how to define them and manipulate them Manipulating our Sphere s GeometryWe can then create a three js clock to track time We use that time to create noise using our imported noise function Noise is just randomness that will help create the effect of a randomly morphing sphere After that three js also provides a function for us to add animation keyframes and we can use the aforementioned three js clock to animate that sphere let noise openSimplexNoise makeNoiseD Date now let clock new THREE Clock renderer setAnimationLoop gt Get the time let t clock getElapsedTime sphereGeometry positionData forEach p idx gt Create noise for each point in our sphere let setNoise noise p x p y p z t Using our Vector function copy the point data and multiply it by the noise this looks confusing but it s just multiplying noise by the position at each vertice v copy p addScaledVector p setNoise Update the positions sphereGeometry attributes position setXYZ idx v x v y v z Some housekeeping so that the sphere looks right sphereGeometry computeVertexNormals sphereGeometry attributes position needsUpdate true Render the sphere onto the page again renderer render scene camera Now our sphere will start morphing I repeated this for the plane behind the sphere too I used a BoxGeometry here with just a basic mesh that makes it look like a wireframe The code for that bit along with everything else is available on CodePen ConclusionMaking d shapes on the web is a great frontend skill to have Although a lot can be done in CSS and HTML ome effects can only be achieved through d and three js provides the perfect platform to do that on I hope you ve enjoyed this quick guide to creating a d morphing sphere in three js and Javascript If you d like more Javascript content you can read all my other stuff here 2022-08-21 17:43:13
海外TECH DEV Community 67 Things to NEVER SAY in a Technical Interview https://dev.to/eludadev/67-things-to-never-say-in-a-technical-interview-1k08 Things to NEVER SAY in a Technical InterviewSo you have an upcoming job interview You re so excited and yet so stressed You re not going to let a second go by without researching every single question that could be asked But we seldom stop to consider the social norms of an interview Like every other real life interaction there are things that are naturally prohibited from being said After countless rejections I ve become succumb to never utter the following sentences Avoid those overused expressions“People love me “I m a team player “I m a very hard worker “I m natural around people “I m an outside the box thinker “I m really passionate about this job “Most people know me as an overachiever “My greatest weakness is that I m a perfectionist One bad practice is using cliche expressions Candidates that keep bloating about their achievements send a negative impression about their personality Remember actions speak louder than words Instead give a short honest and to the point description about your career where you highlight your most important contributions Example I developed and implemented a client service program which expanded my company s small to medium client base by percent Listen carefully speak clearly“Say again “Can you repeat that “Sorry I didn t catch that “Can you speak a bit clearer “I don t understand what you re saying Show your future employer that you re good at listening It s an important workplace skill that will be greatly appreciated by every professional in your field Avoid being arrogant“I don t know “It s on my resume “I might quit in June “How much does this job pay “My work schedule has to be… “No I don t have any questions “This job wasn t my first choice “Can I have time off on Tuesday “I don t really want this job but “I don t have that kind of experience Never ask about your salary or day to day activities before getting an offer Never dismiss your recruiter s question Instead show them that you possess critical thinking skills making you a much more attractive candidate Avoid using slang words“I guess “Cool bro “But Like “That s so sick “That s awesome “OMG I m so excited to hear back “Heyyy what are you doing after work “Wanna go hang out after this interview Try to cut back on the humor when you re being interviewed It s not appropriate to keep spouting unprofessional or even offensive comments in a professional setting Avoid sounding weak desperate or unprepared“Sorry I m late “I need the money for “I need this job really bad “What does this company do “Interviews make me really nervous “How does this company make money “I m going through a difficult time right now “I know I don t have all the experience or skills you want but I can still do the job Don t ask what the company does you should have done your research beforehand It s also important to be on time and to never speak about your lack of experience Example I know that your company has been around for a very long time since the late s and what really caught my attention is that you consistently rank among the top companies to work for by Fortune magazine ️Avoid trash talking your previous job“My old job was horrible “I really hated my last job “My last job didn t pay well “My old boss was really awful “My last employer was the worst “My old company was very mismanaged “I had to leave my old job because of differences with my boss No one wants to employ a skilled person if they re bad mouthing their former jobs It s a sign of bad personality and lack of interest in the profession And whose to say that they won t be saying the same thing about your company Avoid giving bland answers and too many filler words“Yes I like working here “No worries “No problem “Ummmmm “Uhhhhh “Pfft “I have lots of experience in this field “Yes “Okay “Nope “Never done that “I made my last company more efficient “I agree “I understand “Makes sense “Sounds good to me Replace filler words expressions such as “Let me think about it It s also important to elaborate about your achievements using quantifiable contributions and real life objectives ConclusionRemember to dress well be composed and truthful and expect to do of the talking It s an achievement by itself to get the interview Now learn from my prior mistakes and go land your dream job Got questions Drop them in the comments below ️I ll try my best to answer every single one of them 2022-08-21 17:27:00
海外TECH DEV Community Save 100+ hours with this document before building an app/website https://dev.to/pradeepb28_/save-100-hours-with-this-document-before-building-an-appwebsite-2kg0 Save hours with this document before building an app websiteAs an Indie developer it is kind of easy amp obvious to build anything without evaluating the pros n cons of the idea This is because in product management process developers are tend to be on the solution side of the customer But as an Indie you should see yourself how to work on the problem side of the customer too Before building one should answer to the following questions What s your idea one liner What s the opportunity size Who s your target audience What is are the problem s What is are the solution s How do you monetize it What are the other alternatives You can evaluate and manage your ideas in notion documentDownload document 2022-08-21 17:20:53
海外TECH DEV Community How to create a test database with Laravel Sail https://dev.to/alejandroakbal/how-to-create-a-test-database-with-laravel-sail-528d How to create a test database with Laravel Sail IntroductionI have worked on projects that required the production and testing database to be the same This could be because some features work in MariaDB but not in SQLite Or some bugs appear in MySQL but not in PostgreSQL When you re working in a large project you need to know that the testing database works exactly like the one in production You can t allow a bug to appear in production because the test database was different Note If the project is small chances are you are fine using SQLite for testing Today I m going to guide you through setting up a testing database in your current database server thanks to Laravel Sail Before we startThis tutorial uses PostgreSQL as the database But the idea is the same for any other database create a separate database in your current database server Preface RequirementsLaravel Laravel Sail Database setupWe will use the database server declared in the docker compose yml file In this case PostgreSQL services pgsql image postgres First enter PostgreSQL s CLIsail psqlNote If you are using MySQL you can use sail mysql instead Now create a new databaseCREATE DATABASE testing This database is separated from the default database that your application uses PHPUnit configurationNow modify the phpunit xml file to use the new database and database server Should end up similar to this lt php gt lt env name DB CONNECTION value pgsql gt lt env name DB DATABASE value testing gt lt php gt Run the testsNow you can run the tests and see if they work sail test parallelIt should look similar to this PASS Tests Unit ExampleTest ✓example Tests passed Time s EndThat was it It s a one time setup that works like a charm Self promotionIf you have found this useful then you should follow me I will be posting more interesting content GitHubTwitterDev to ConclusionCongratulations today you have learned how to create a test database in Laravel Sail Without needing to modify the docker compose yml file or creating more services Let me know if the tutorial was useful to you in the comments 2022-08-21 17:16:13
海外TECH Engadget Netflix’s ad-supported tier might not play commercials during new movies https://www.engadget.com/netflix-ad-supported-tier-might-not-include-movie-ads-173947407.html?src=rss Netflix s ad supported tier might not play commercials during new moviesNetflix s forthcoming ad supported tier could include programming without commercials According to Bloomberg the company doesn t plan to run ads during original movies at least when they first premiere on the platform In doing so Netflix reportedly hopes to keep its service appealing to high profile filmmakers who may find the idea of commercials interrupting their stories unappealing Content for children could also be free of ads Netflix has reportedly told partners it won t run commercials during original kids programming Some of the company s current agreements would not allow it to run ads during licensed content either Netflix may feel serving commercials to kids would be more trouble than it s worth In Google paid million for violating the Children s Online Privacy Protection Act after the FTC found YouTube had illegally collected data from kids Bloomberg warns Netflix is still finalizing plans for its ad supported tier and the company s strategy could change between now and when the service eventually launches On that note code recently found by developer Steve Moser suggested the new tier could also drop support for offline viewing Netflix quickly responded to the rumor by pointing out it was still in the “early days of deciding how to launch a lower priced ad supported option 2022-08-21 17:39:47
ニュース BBC News - Home Tyson Fury makes emotional knife plea over cousin's death https://www.bbc.co.uk/news/uk-england-lancashire-62624382?at_medium=RSS&at_campaign=KARANGA altrincham 2022-08-21 17:39:28
ニュース BBC News - Home Newcastle United 3-3 Manchester City: Pep Guardiola's side fight back from 3-1 down to get a draw https://www.bbc.co.uk/sport/football/62537744?at_medium=RSS&at_campaign=KARANGA Newcastle United Manchester City Pep Guardiola x s side fight back from down to get a drawManchester City produce a brilliant fightback as they recover from down to draw at Newcastle in a pulsating match featuring six goals and an overturned red card 2022-08-21 17:43:03
ニュース BBC News - Home European Championships: Vladimir Harutyunyan crash lands on two dives https://www.bbc.co.uk/sport/av/diving/62626676?at_medium=RSS&at_campaign=KARANGA European Championships Vladimir Harutyunyan crash lands on two divesWatch as Armenian diver Vladimir Harutyunyan has an afternoon to forget with two crash landings at the European Aquatics Championships in Rome 2022-08-21 17:19:19
ビジネス ダイヤモンド・オンライン - 新着記事 テストの解答用紙を見ると分かる ミスが多い子の共通点 - 中学受験必勝ノート術 https://diamond.jp/articles/-/307348 テストの解答用紙を見ると分かるミスが多い子の共通点中学受験必勝ノート術約年間、人以上のお子さんを指導してきた中学受験専門のカリスマ家庭教師・安浪京子先生は「ノートをひと目見ると、その子の学力や伸びしろがわかる」と言います。 2022-08-22 02:55:00
ビジネス ダイヤモンド・オンライン - 新着記事 【売れないチラシを売れるチラシに変える心理学】権威効果とは? - 「A4」1枚チラシで今すぐ売上をあげるすごい方法 https://diamond.jp/articles/-/308067 2022-08-22 02:50:00
ビジネス ダイヤモンド・オンライン - 新着記事 【20代で1億円を貯めた元会社員が断言】 仕事をサボれない真面目な人は自覚すべき… “経済的自由”を最短最速で獲得するため 絶対に欠かせないこと - 投資をしながら自由に生きる https://diamond.jp/articles/-/307746 2022-08-22 02:45:00
ビジネス ダイヤモンド・オンライン - 新着記事 他人の言うことにいちいち傷つかなくなる方法【書籍オンライン編集部セレクション】 - 宇宙人が教える ポジティブな地球の過ごし方 https://diamond.jp/articles/-/307966 人間関係 2022-08-22 02:40:00

コメント

このブログの人気の投稿

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