js |
JavaScriptタグが付けられた新着投稿 - Qiita |
駆け出しプログラマ向け、実務で使える「効率性」ってなに? |
https://qiita.com/Yohei_Shiina/items/01236ac8a7752c02798f
|
目的達成の際にリソースを無駄に消費しないこと効率性をコードに適用した例ある名前がリストに登録されているかを確認し、登録状態に応じて何かの処理をしてくれる関数、を例にしてみましょう。 |
2021-08-21 17:09:35 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
.zshrcによくある記述がわからない。 |
https://teratail.com/questions/355431?rss=all
|
zshrcによくある記述がわからない。 |
2021-08-21 17:46:49 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
vimrcの内容が反映されません |
https://teratail.com/questions/355430?rss=all
|
vimrcの内容が反映されません前提・実現したいことvimrcを必ず反映するようにしたい発生している問題・エラーメッセージvimrcに書いた内容が反映されません補足情報FWツールのバージョンなどvimrcにsetnbspsmartindentと入力していますが反映されませんverbosenbspsetnbspsmartindentと入力して調べたところLastnbspsetnbspfromnbspusrsharevimvimindentcssvimnbsplinenbspとなっていました。 |
2021-08-21 17:46:23 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Ruby on railsでdeviseで新規登録する時、public_uidのgemを使ってユーザー一人ひとりに個人番号を自動で作成したい。 |
https://teratail.com/questions/355429?rss=all
|
Rubyonrailsでdeviseで新規登録する時、publicuidのgemを使ってユーザー一人ひとりに個人番号を自動で作成したい。 |
2021-08-21 17:45:22 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
tkinter.PhotoImageで画像が開けないと表示される |
https://teratail.com/questions/355428?rss=all
|
tkinterPhotoImageで画像が開けないと表示されるptyhonでtkinterPhotoImageを使い、画像を表示させようとすると以下の画像のようなエラーが出ます。 |
2021-08-21 17:32:10 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
VS codeの拡張機能をデバッグしたい |
https://teratail.com/questions/355427?rss=all
|
typescript |
2021-08-21 17:15:42 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
for文を使って配列に値を足しつつ、配列の数も増やしていく方法が知りたい |
https://teratail.com/questions/355426?rss=all
|
for文を使って配列に値を足しつつ、配列の数も増やしていく方法が知りたいphpnbsp会員idに対して自動でデータベースのレコードを割り当てるプログラムを作りたいと思っています。 |
2021-08-21 17:11:06 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
opencv dnnモジュールで連続して検出できない |
https://teratail.com/questions/355425?rss=all
|
opencvdnnモジュールで連続して検出できない前提・実現したいことCCLIにて学習済みのモデルを使って物体検出のプログラムの作成をしています。 |
2021-08-21 17:09:14 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
AWS lambda@edgeでのbasic認証後のユーザ名をオリジン(lambda)に渡す方法 |
https://teratail.com/questions/355424?rss=all
|
AWSlambdaedgeでのbasic認証後のユーザ名をオリジンlambdaに渡す方法前提・実現したいことAWSnbspcloudfrontのlambdaedgeでBASIC認証機能を実装しています。 |
2021-08-21 17:04:18 |
Linux |
CentOSタグが付けられた新着投稿 - Qiita |
初めてのCentOS7:タスクスケジューラみたいに定期でコマンドを動かしたかった |
https://qiita.com/moomim/items/c99168068e671f87f5a7
|
shellファイルの保存ディレクトリ移動cdrootshellファイルの保存ディレクトリshellファイルの実行権限付与chmodaxshellのファイル名⑤crontab用のconfファイルを作成する。 |
2021-08-21 17:54:58 |
Git |
Gitタグが付けられた新着投稿 - Qiita |
<初学者向け>Gitの最低限の流れ |
https://qiita.com/matarou0212/items/898ca04713e768b62ffa
|
そうする事で、メインは影響受けずに同時に変更を進められるGitの大まかな流れローカルリポジトリの新規作成をしてリポジトリを作成最初の回のみgitinnit変更履歴を記録gitcommitmメッセージ※メッセージには、どこを変更したか分かる様なメッセージを入れるgitaddファイル名※全てコミットする場合はgitadd状況確認gitdiffリポジトリとワークツリーの変更内容を確認gitstatus変更ファイルを確認履歴の確認gitlog変更内容を確認元に戻したい時色々変更してエラーが出たけどどこかわからない・・・一旦戻そうgitrestoreltファイル名gtワークツリーの変更を取り消すgitrestorestagedltファイル名gtステージにあげたファイル名変更をワークツリーまで戻すブランチについてチーム開発では、ブランチが必要になる①を作業している時②を作業しないといけない時に同時に進められるブランチを作成するgitbranchブランチ名ブランチ名についてmainメインで作業してるブランチmaster公開するものを置くブランチdevelop開発中のものを置くブランチrelease次にリリースするものを置くブランチfeature新機能開発中に使うブランチhotfix公開中のもののバグ修正用ブランチブランチ一覧を表示gitbranchgitbranchaGitHabのブランチも含めた全てを表示※aallブランチを切り替えるブランチを作っただけでそこには移動してない※HEAD自分がいるブランチgitswitchfeature例でfeatureとするgitswitchcfeature分岐のブランチを作成、かつ、そこに移動※ccreate変更内容をマージ取り込むgitmergefeature新しいコミットで、mainとfeatureを取り込めるgitmergeoriginmainGitHab上のブランチをマージしたい時コンフリクト変更内容の衝突→mainとfeatureで同じ箇所なのに違う編集をしてしまったlt解消方法gt①ファイルの内容を正しい方に修正②ltltgtgtを削除GitHubと通信初期設定GitHubに登録→Gitの初期設定gitconfigglobalusernameGitHubのユーザーネームgitconfigglobaluseremailGitHubのメールアドレス※ローカルにリポジトリがあればローカルと同じ名前のリポジトリをGitHub上にも作る接続リモートリポジトリの追加gitremoteaddoriginURLリモートのURLをローカルに登録する→今後、originという名前でGitHubとやりとりできるpushGitHubにコードをアップgitpushoriginmainpullローカルに取り込み、ワークツリーに変更内容を反映fetchmergegitpulloriginmainoriginmainは省略可能・コンフリクトが起きたら修正が難しい・mainブランチにいる時はpullの方が※fetchローカルに取り込むだけ→ワークツリーに反映させたいmergeでワークツリーに取り込む・mainブランチ以外にいる時はfetchmergeの方がプルリクエスト「変更のレビュー→問題なければ取り込む」を依頼する事コードレビューmerge変更するを取り込み、ブランチを削除おわりにうまくまとめれているかわかりませんが、誰かの役に立てたら良いと思います。 |
2021-08-21 17:48:16 |
技術ブログ |
Mercari Engineering Blog |
All for Oneでたのしいおさわりかいをするよ! |
https://engineering.mercari.com/blog/entry/20210821-osawarikai/
|
hellip |
2021-08-21 10:00:14 |
海外TECH |
DEV Community |
How to make fully responsive modern portfolio using pure HTML, CSS and JS. |
https://dev.to/kunaal438/how-to-make-fully-responsive-modern-portfolio-using-pure-html-css-and-js-1p65
|
How to make fully responsive modern portfolio using pure HTML CSS and JS Hello Today we ll see how to make a fully responsive modern portfolio using pure HTML CSS and JS No other library You learn to create responsive design you ll learn about CSS pseudo elements You ll learn about nodemailer to make a working contact form And much more To see demo or you want coding tutorial with explanation You can watch the tutorial below Video TutorialI appreciate if you can support me by subscribing my youtube channel So without wasting more time let s see how to code this CodeBefore we start writing our code Let s see its folder structure And yes it is a nodeJS app because we want working mailing system and only servers can send mail not client side browser As you can notice we have project js file This files contain our project data Having a project data make easier for you to add and delete or edit any project you want Let s see its data structure let projects name project one tags javascript fullstack ui ux backend image project png name project two tags javascript fullstack image project png more You can see we have project name its tags and image path This way we can easily handle our projects without editing any code So let s start by initializing NPM NPM initInside your root directory outside public folder open your command prompt or terminal and run npm init cmd This will initialize NPM to your projects Now run this command to install these libraries npm i express js nodemon nodemailer dotenvexpress js is to create a servernodemon is to run server continuouslynodemailer is to send mailsdotenv is for making environment variable We ll use this store our email id and password outside of server After done installing libraries Let s make some changes in package json Open it And change its scripts data scripts start nodemon server js Then make server js file inside your root directory not in public folder Open it Server jsStart by importing libraries packages const express require express const path require path const nodemailer require nodemailer const dotenv require dotenv Setup dotenv so we can access environment variable dotenv config Then store your public folder path to a variable and make server let initialPath path join dirname public let app express Now use app use method to setup middlewares app use express static initialPath app use express json They both are important express json will enable form data sharing and express static will set public folder as a static path After this make home route And send index html file app get req res gt res sendFile path join initialPath index html And at last make server listen on port app listen gt console log listening So our server is done for now Let s run the server by running npm start cmd on your terminal Now let s start working on portfolio PortfolioOpen index html and write basic HTML structure Then link style css and app js to the file After that make navbar lt navbar gt lt nav class navbar gt lt h class brand gt logo lt h gt lt div class toggle btn gt lt span gt lt span gt lt span gt lt span gt lt div gt lt ul class links container gt lt li class links item gt lt a href class link active gt home lt a gt lt li gt lt li class links item gt lt a href project section class link gt project lt a gt lt li gt lt li class links item gt lt a href about section class link gt about lt a gt lt li gt lt li class links item gt lt a href contact section class link gt contact lt a gt lt li gt lt ul gt lt nav gt And give it some styles margin padding box sizing border box html scroll behavior smooth body width position relative background ddd color fff font family roboto sans serif navbar navbar position fixed top left width height px background ddd padding vw display flex justify content space between align items center z index brand text transform capitalize font weight links container display flex list style none link text transform capitalize color fff text decoration none margin px padding px position relative link hover not active opacity link active before seperator before content position absolute bottom left transform translateX width px height px border radius background fff link active after seperator after content position absolute bottom px left width height px background fff NoteYou can see scroll behavior given to html If you don t give this you ll not be able to get smooth scrolling effect you can also see seperator element in the styles but don t worry we ll create this later OutputNow create header section lt home section gt lt section class home gt lt div class hero content gt lt h class hero heading gt lt span class highlight gt hi lt span gt i am john lt h gt lt p class profession gt web developer lt p gt lt p class info gt Lorem ipsum dolor sit amet consectetur adipisicing elit Consequatur odit in laudantium suscipit blanditiis asperiores lt p gt lt a href contact section class btn gt contact lt a gt lt div gt lt img src img img png class image alt gt lt section gt home section home width min height calc vh px height auto margin top px padding vw display flex align items center justify content space between position relative hero content width hero heading font size rem text transform capitalize font weight highlight color ff profession width fit content display block margin px px margin left auto text transform capitalize position relative padding px px color ddd z index profession before content position absolute top left width height background eee z index transform skewX deg profession after content position absolute top left px width px height px background eee info line height px margin bottom px btn padding px px text decoration none border radius px background ff color fff text transform capitalize border none OutputGreat now make about section lt about section gt lt section class about id about section gt lt h class heading gt about lt span class highlight gt me lt span gt lt h gt lt p class sub heading gt Lorem ipsum dolor sit amet consectetur lt p gt lt div class seperator gt lt div gt lt div class about me container gt lt div class left col gt lt img src img img png class about image alt gt lt div gt lt div class right col gt lt p class about para gt Lorem ipsum dolor sit amet consectetur adipisicing elit Accusamus totam quia numquam tempora nostrum earum similique enim laudantium iusto Quaerat illo numquam minus pariatur cum qui ipsum sapiente atque optio voluptatibus necessitatibus quis dolores veniam delectus inventore beatae Accusamus illum Non nam dolores assumenda quibusdam repellat beatae quae eum atque sed velit culpa at animi cumque suscipit Ratione delectus dolores odit dicta ipsum libero molestiae et reprehenderit sapiente earum Alias aut architecto quis earum iusto beatae quibusdam maiores rerum consequatur aliquid doloribus Quas accusantium quidem eos ex aperiam recusandae Veritatis lt p gt lt a href class btn gt download cv lt a gt lt div gt lt div gt lt section gt about section about width height auto padding px vw heading text align center font weight font size rem text transform capitalize sub heading text align center font size rem margin px opacity seperator width margin px auto position relative about me container margin px px width display grid grid template columns grid gap px left col right col position relative left col before content yes its me text transform capitalize position absolute right top px left col after content position absolute top px right px width px height px background fff transform origin right transform rotate deg about image border radius px box shadow px px rgba about para font size rem font weight line height px margin bottom px OutputAnd now create skills section Add this structure inside about section lt section class about id about section gt previous elements lt h class heading gt languages and framework i know lt h gt lt div class seperator gt lt div gt lt div class skill container gt lt div class skill card style bg f gt lt p class skill gt HTML lt p gt lt div gt lt div class skill card style bg ad gt lt p class skill gt CSS lt p gt lt div gt lt div class skill card style bg cc gt lt p class skill gt SCSS lt p gt lt div gt lt div class skill card style bg fdfe gt lt p class skill gt JavaScript lt p gt lt div gt lt div class skill card large style bg edfb gt lt p class skill gt ReactJS lt p gt lt div gt lt div class skill card large style bg cd gt lt p class skill gt NodeJS lt p gt lt div gt lt div class skill card style bg gt lt p class skill gt Postgres SQL lt p gt lt div gt lt div class skill card style bg ffa gt lt p class skill gt Firebase lt p gt lt div gt lt div class skill card large style bg edfb gt lt p class skill gt Much More lt p gt lt div gt lt div gt lt section gt You can notice we have style bg value to skill card element What this is doing is it is setting up different bg CSS variable for different elements So this way we can add same effect with different colors skill container position relative margin top px display grid grid template columns repeat fr grid gap px skill card height px border radius px border px solid text align center position relative cursor pointer transition s skill font size rem color line height px skill card hover background var bg skill card hover skill color fff skill card large grid column span Outputbackground color is showing on hoverNow let s create project section In project section first make filter buttons lt project section gt lt section class project id project section gt lt h class heading gt Project lt span class highlight gt s lt span gt lt h gt lt p class sub heading gt Lorem ipsum dolor sit amet consectetur lt p gt lt div class seperator gt lt div gt lt div class filters gt lt button class filter btn active id all gt all lt button gt lt button class filter btn id javascript gt javaScript lt button gt lt button class filter btn id ui gt ui ux lt button gt lt button class filter btn id backend gt backend lt button gt lt button class filter btn id fullstack gt fullStack lt button gt lt div gt lt section gt The id attribute in filters will help us in filtering the projects project section project contact position relative padding px vw filters width fit content display block margin px auto filter btn padding px px border radius px border none text transform capitalize margin px px cursor pointer filter btn active background ff color fff OutputAnd now just for styling purpose make single project card lt div class project container gt lt div class project card gt lt img src img project png alt gt lt div class content gt lt h class project name gt project one lt h gt lt span class tags gt javascript lt span gt lt div gt lt div gt lt div gt project container width display grid grid template columns repeat fr grid gap px project card position relative cursor pointer display block project card img width height object fit cover project card content position absolute top left width height background rgba display flex justify content center align items center transition s text transform capitalize opacity project name font weight font size rem text align center tags position absolute bottom px opacity width project card hover content opacity project card hide display none OutputContent is showing on hoverNow you can comment the project card lt div class project container gt lt lt div class project card gt lt img src img project png alt gt lt div class content gt lt h class project name gt project one lt h gt lt span class tags gt javascript lt span gt lt div gt lt div gt gt lt div gt And let s make project card dynamically But before doing that Add you project js file before app js file Otherwise you ll not be able to access project data lt script src project js gt lt script gt lt script src app js gt lt script gt Now open app js And before making project card Let make the links toggle active class For that code this linksconst links document querySelectorAll link links forEach link gt link addEventListener click gt links forEach ele gt ele classList remove active link classList add active And after doing that we are good to go on project cards So code this creating dynamic project cardconst projectContainer document querySelector project container projects forEach project gt projectContainer innerHTML lt div class project card data tags all project tags gt lt img src img project image alt gt lt div class content gt lt h class project name gt project name lt h gt lt span class tags gt project tags lt span gt lt div gt lt div gt You can see we are just selecting the project container and then looping through the data to make cards OutputGreat now make filter button functional filtersconst filters document querySelectorAll filter btn filters forEach filterBtn gt filterBtn addEventListener click gt let id filterBtn getAttribute id let projectCards document querySelectorAll project card projectCards forEach card gt if card getAttribute data tags includes id card classList remove hide else card classList add hide filters forEach btn gt btn classList remove active filterBtn classList add active In above code we are just adding click event to filter button and toggling some elements class So out project section is fully done Now make contact form lt contact form gt lt section class contact id contact section gt lt h class heading gt Contact lt span class highlight gt me lt span gt lt h gt lt p class sub heading gt Lorem ipsum dolor sit amet consectetur lt p gt lt div class seperator gt lt div gt lt div class contact form gt lt div class name gt lt input type text class first name required placeholder first name gt lt input type text class last name required placeholder last name gt lt div gt lt input type email required class email placeholder email gt lt textarea class message placeholder message required gt lt textarea gt lt button class btn contact btn gt contact lt button gt lt div gt lt section gt lt footer class footer gt made with love by modern web lt footer gt contact form contact form width margin top px position relative contact form input message width display block height px padding px border radius px background color fff border none outline none margin px text transform capitalize resize none message height px contact form name display flex justify content space between name input width margin contact form btn display block margin auto cursor pointer footer footer width height px text align center background color ff text transform capitalize line height px OutputNow let s make mail route inside server jsapp post mail req res gt const firstname lastname email msg req body const transporter nodemailer createTransport service gmail auth user process env EMAIL pass process env PASSWORD const mailOptions from sender email to receiver email subject Postfolio text First name firstname nLast name lastname nEmail email nMessage msg transporter sendMail mailOptions err result gt if err console log err res json opps it seems like some error occured plz try again else res json thanks for e mailing me I will reply to you within working days This is a way to send mail with nodemailer There are some thing you have to notice process env EMAIL amp process env PASSWORD this keyword give you access to environment variable but we haven t made any variable for that Create a file in your root directory env Name should be the same Open it and type this EMAIL your emailPASSWORD your email s passwordSo now if you understand process env will access these variables from amp to parameters In the code above I have not entered my email s but in order to make mail work you have to give email id as their params You can give same email id to both So out server is fully done Now make contact form working contact formconst contactBtn document querySelector contact btn const firstName document querySelector first name const lastName document querySelector last name const email document querySelector email const msg document querySelector message contactBtn addEventListener click gt if firstName value length amp amp lastName value length amp amp email value length amp amp msg value length fetch mail method post headers new Headers Content Type application json body JSON stringify firstname firstName value lastname lastName value email email value msg msg value then res gt res json then data gt alert data In above code I am just selecting all forms input and making POST request to mail route Our contact form is also Done Now make this website responsive Responsive Tablet tablet view media max width px html font size px toggle btn toggle btn position absolute width px height px right vw cursor pointer toggle btn span position absolute width height px background fff top transition s toggle btn span nth child top toggle btn active span nth child top transform rotate deg toggle btn active span nth child top transform rotate deg links links container position absolute top px background ddd width left padding vw flex direction column transition s opacity pointer events none links container show opacity pointer events all link margin left auto text align center display block height px home section home flex direction column reverse height fit content padding bottom px home image width px margin px hero content width min width px text align center hero heading font size rem about section about me container grid template columns fr left col margin auto width min width px skill container project container grid template columns repeat fr skill card grid column span important You can see we are styling toggle btn here But to make it function you need to code this inside app js toggle buttonconst toggleBtn document querySelector toggle btn const linkContainer document querySelector links container toggleBtn addEventListener click gt toggleBtn classList toggle active linkContainer classList toggle show Responsive Mobile mobile view media max width px html font size px p sub heading about para left col before tags font size rem about image width margin auto display block skill container project container grid template columns fr skill font size rem project name font size rem name flex direction column name input width first name margin bottom px important You can watch responsive part on video tutorial for outputSo that s it I hope you understood each and everything If you have doubt or I missed something let me know in the comments Articles you may find UsefulBest CSS EffectMusic Player AppDisney CloneYoutube API Youtube CloneTMDB Netflix CloneI really appreciate if you can subscribe my youtube channel I create awesome web contents Thanks For reading |
2021-08-21 08:45:03 |
海外TECH |
DEV Community |
Day 8 : Learning JS Fundamentals, Part-2 |
https://dev.to/gauravshekhawat/day-8-learning-js-fundamentals-part-2-4nll
|
Day Learning JS Fundamentals Part see the below example In the function above we have not declared the variables teacher and topic still we assigned them values When we call this function this changes the value of the teacher variable present in the global while the topic will be declared as a new variable in the global scope hence the output of the last line will be React Undefined vs Undeclaredclear from the name function expressionsFunction expressionArrow function Expressionsjust skim through the above two articles starting paragrpahs The first function above is an example of anonymous function expression while the second is a named function expression Example for arrow functions Immediately invoked function expressionsThese are used in places of our code where we need to collect a set of variables and protect them from encroaching upon an outer scope These are not used nowadays instead block scoping is used with let Block scoping In the below example the variable temp will be available only inside the if block var are good when you want to define a variable at a function level as the scope of var is global or the function in which it is defined |
2021-08-21 08:39:43 |
海外TECH |
DEV Community |
How to install ImageMagick? |
https://dev.to/thanhmaifpt/nang-cap-mang-fpt-thay-doi-goi-cuoc-fpt-2e6j
|
How to install ImageMagick I ve recently picked up interest in contributing to this platform forem dev to so I ve been reading the documentation I m now stuck on the installation of ImageMagick I run on Windows OS so im not sure if i m to install ImageMagick on WSL or on my machine itself Please help clarify Thanks |
2021-08-21 08:12:41 |
海外ニュース |
Japan Times latest articles |
COVID-19 tracker: Tokyo reports over 5,000 cases for fourth straight day |
https://www.japantimes.co.jp/news/2021/08/21/national/japan-coronavirus-august-21/
|
tokyo |
2021-08-21 17:08:08 |
ニュース |
BBC News - Home |
Westminster double murder: Police release image of wanted man |
https://www.bbc.co.uk/news/uk-england-london-58282070
|
london |
2021-08-21 08:36:57 |
北海道 |
北海道新聞 |
稲見が首位堅持、高橋1打差 CATレディースゴルフ第2日 |
https://www.hokkaido-np.co.jp/article/580583/
|
神奈川県 |
2021-08-21 17:16:00 |
北海道 |
北海道新聞 |
男子ゴルフ、上井邦裕が単独首位 38歳未勝利、第3日 |
https://www.hokkaido-np.co.jp/article/580582/
|
単独首位 |
2021-08-21 17:16:00 |
北海道 |
北海道新聞 |
パラ、コロナ対策が「成功の鍵」 IPC会長、バブル方式に自信 |
https://www.hokkaido-np.co.jp/article/580581/
|
国際パラリンピック委員会 |
2021-08-21 17:06:00 |
北海道 |
北海道新聞 |
インターハイ、青森山田が決勝へ サッカー男子、米子北と対戦 |
https://www.hokkaido-np.co.jp/article/580580/
|
体育大会 |
2021-08-21 17:06:00 |
北海道 |
北海道新聞 |
オ2―0西(21日) オリックスが4連勝 |
https://www.hokkaido-np.co.jp/article/580579/
|
西日 |
2021-08-21 17:06:00 |
ビジネス |
東洋経済オンライン |
日本史の「もしも」を考えることで見えてくる本質 ありえなかった過去の想像が未来につながる | リーダーシップ・教養・資格・スキル | 東洋経済オンライン |
https://toyokeizai.net/articles/-/447314?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
東洋経済オンライン |
2021-08-21 17:30:00 |
コメント
コメントを投稿