ROBOT |
ロボスタ |
ポスターから人物やキャラクターが飛び出す「ARボリュメトリックビデオポスター」ギターウルフのボーカルが3D立体映像で出現 |
https://robotstart.info/2022/09/12/curiosity-3dposter.html
|
|
2022-09-12 05:37:52 |
IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] 明治、値上げ 「おいしい牛乳」「ブルガリアヨーグルト」など115品 |
https://www.itmedia.co.jp/business/articles/2209/12/news113.html
|
itmedia |
2022-09-12 14:33:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia PC USER] 実効速度「5Gbps超」を確認 IntelとBroadcomが「Wi-Fi 7」の相互接続テストを実施 |
https://www.itmedia.co.jp/pcuser/articles/2209/12/news116.html
|
broadcom |
2022-09-12 14:30:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia PC USER] Keychron、有線/無線両対応のテンキーレスメカニカルキーボード |
https://www.itmedia.co.jp/pcuser/articles/2209/12/news119.html
|
itmediapcuserkeychron |
2022-09-12 14:29:00 |
TECH |
Techable(テッカブル) |
ベントレーとマッカランが異色のコラボ! 限定ウィスキーのサステナブルな水平ボトルが美しい |
https://techable.jp/archives/185411
|
自動車メーカー |
2022-09-12 05:00:44 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
148.Proxyについて |
https://qiita.com/gucho-n/items/58e8e3c585c9262e536f
|
proxy |
2022-09-12 14:30:24 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
プリザンターのスクリプトを jQuery Deffered で実行する |
https://qiita.com/implune/items/8d0baba06a70cf7bc262
|
deferred |
2022-09-12 14:14:56 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
プリザンターのスクリプトを非同期に実行してみる |
https://qiita.com/implune/items/62b84196a2ddc5a723dc
|
scriptthiscouldbeoutdated |
2022-09-12 14:11:00 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
Pumaの再起動に時間がかかる |
https://qiita.com/lyd-ryotaro/items/43cbf41fd28d7d3c4e86
|
elasticbeanstalk |
2022-09-12 14:46:42 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
Pumaの再起動に時間がかかる |
https://qiita.com/lyd-ryotaro/items/43cbf41fd28d7d3c4e86
|
elasticbeanstalk |
2022-09-12 14:46:42 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
Render.comでRailsアプリをデプロイする方法 |
https://qiita.com/nekohasy/items/db947e2214bec964c554
|
rendercom |
2022-09-12 14:43:46 |
技術ブログ |
Developers.IO |
[Terraform] [Cloud Functions] 環境変数をyamlファイルから読み込みたい |
https://dev.classmethod.jp/articles/cloud_functions_terraform/
|
cloud |
2022-09-12 05:55:20 |
海外TECH |
DEV Community |
Create a todo app with thirdweb deploy and Next.js |
https://dev.to/thirdweb/create-a-todo-app-with-thirdweb-deploy-and-nextjs-49l3
|
Create a todo app with thirdweb deploy and Next jsThis guide will show you how to build a full web application that allows users to create an on chain to do list using Solidity for the smart contract and Next js for the application Before we get started below are some helpful resources where you can learn more about the tools we re going to be using in this guide Full project source code Release amp DeployLet s get started Creating the Smart ContractTo build the smart contract we will be using Hardhat Hardhat is an Ethereum development environment and framework designed for full stack development in Solidity Simply put you can write your smart contract deploy it run tests and debug your code Setting up a new hardhat projectCreate a folder where the hardhat project and the Next js app will go To create a folder open up your terminal and execute these commandsmkdir todo dappcd todo dappNow we will use the thirdweb CLI to generate a new hardhat project So run this command npx thirdweb create contractWhen it asks for what type of project you need to select an empty project Now you have a hardhat project ready to go Writing the smart contractOnce the app is created create a new file inside the contracts directory called Todo sol and add the following code SPDX License Identifier MIT specify the solidity version herepragma solidity contract Todos We will declare an array of strings called todos string public todos We will take todo as input and push it inside the array in this function function setTodo string memory todo public todos push todo In this function we are just returning the array function getTodo public view returns string memory return todos Here we are returning the length of the todos array function getTodosLength public view returns uint uint todosLength todos length return todosLength We are using the pop method to remove a todo from the array as you can see we are just removing one index function deleteToDo uint index public require index lt todos length This todo index does not exist todos index todos getTodosLength todos pop This smart contract allows you to add todos to your contract remove them get their length and return the array which consists of all the tasks you have set up Now that we have written our basic Todos smart contract we will go ahead and deploy our contract using deploy Deploying the contractnpx thirdweb deployThis command allows you to avoid the painful process of setting up your entire project like setting up RPC URLs exporting private keys and writing scripts Upon success a new tab will automatically open and you should be able to see a link to the dashboard in your CLI Now choose the network you want to deploy your contract to I am going to use Goerli but you can use whichever one you like Once you have chosen your network click on Deploy now After the transactions are mined you will be taken to the dashboard which consists of many options In the overview section you can explore your contract and interact with the functions without having to integrate them within your frontend code yet so it gives you a better idea of how your functions are working and also acts as a good testing environment In the code section you see the different languages and ways you can interact with your contract Which we will look into later on in the tutorial In the events section you can see all the transactions you make You can also customize the settings after enabling the required interfaces in the settings section In the source section you can see your smart contract and it also gives you a verification button to the relevant chain to which you have deployed your contract Creating the FrontendI am going to use the Next js Typescript starter template for this guide If you are following along with the guide you can create a project with the template using the thirdweb CLI npx thirdweb create next tsIf you already have a Next js app you can simply follow these steps to get started Install thirdweb dev react and thirdweb dev sdk and ethers Add MetaMask authentication to the site You can follow this guide to do this By default the network is Mainnet we need to change it to Goerliimport type AppProps from next app import ChainId ThirdwebProvider from thirdweb dev react This is the chainId your dApp will work on const activeChainId ChainId Goerli function MyApp Component pageProps AppProps return lt ThirdwebProvider desiredChainId activeChainId gt lt Component pageProps gt lt ThirdwebProvider gt export default MyApp Create todo functionalityLet s now go to pages index tsx and firstly get the wallet address of the user like this const address useAddress Then we are going to check if the address exists and if it does we are going to show a simple input and button to create a new todo lt div gt address lt div gt lt input value input onChange e gt setInput e target value placeholder Enter todo gt lt WebButton contractAddress contractAddress action contract gt contract call setTodo input gt Set Todo lt WebButton gt lt div gt lt ConnectWallet gt lt div gt We are using a state to store the value of a state variable and I have also created a variable for contractAddress as it will be used in multiple places const contractAddress xddAFBFBccAffFddDb const input setInput useState To get the contract address go to your contract on thirdweb and copy the contractIf you now check out the app you will be able to add todos Read todos functionalityUsing the useContract and useContractData hooks we will get the todos like this const contract useContract contractAddress const data isLoading useContractData contract getTodo Now we will check if the todos are loading and if it is loading we will show a loading screen otherwise we will show the todos lt div gt isLoading Loading lt ul gt data map item string index number gt lt li key index gt item lt li gt lt ul gt lt div gt You will now be able to see all the todos Adding delete functionalityWhere we are mapping through all the todos we will add another WebButton that will be responsible for deleting the todos data map item string index number gt lt li key index gt item lt WebButton contractAddress contractAddress action contract gt contract call deleteToDo index gt Delete Todo lt WebButton gt lt li gt Adding some stylesWe will add some basic styles to our app so it looks good So create a globals css file in the styles folder and add the following html body padding margin font family apple system BlinkMacSystemFont Segoe UI Roboto Oxygen Ubuntu Cantarell Fira Sans Droid Sans Helvetica Neue sans serif a color inherit text decoration none box sizing border box Now import it in app tsx like this import styles globals css Let s style the home page now Create a file Home module css and add the following container display flex flex direction column align items center justify content center width vw min height vh background color cffee todo display flex align items center justify content space between gap px margin top px todo gt span gt button border none height px important todoForm display flex align items center justify content space between margin top px gap px todoForm gt span gt button border none height px important Finally add the classNames import ConnectWallet useAddress useContract useContractData WebButton from thirdweb dev react import type NextPage from next import useState from react import styles from styles Home module css const Home NextPage gt const address useAddress const contractAddress xddAFBFBccAffFddDb const input setInput useState const contract useContract contractAddress const data isLoading useContractData contract getTodo return lt div className styles container gt address lt gt lt div className styles todoForm gt lt input value input onChange e gt setInput e target value placeholder Enter todo gt lt WebButton contractAddress contractAddress action contract gt contract call setTodo input accentColor ce gt Set Todo lt WebButton gt lt div gt lt div gt isLoading Loading lt ul gt data map item string index number gt lt li key index className styles todo gt item lt WebButton contractAddress contractAddress action contract gt contract call deleteToDo index accentColor ce gt Delete Todo lt WebButton gt lt li gt lt ul gt lt div gt lt gt lt ConnectWallet accentColor ce colorMode light gt lt div gt export default Home Now we have an awesome web to do app ready ConclusionIn this guide we ve learned how to build a full stack web todo app If you did as well pat yourself on the back and share it with us on the thirdweb discord |
2022-09-12 05:29:14 |
海外TECH |
DEV Community |
Allow GitHub contributors to mint an NFT |
https://dev.to/thirdweb/allow-github-contributors-to-mint-an-nft-5a52
|
Allow GitHub contributors to mint an NFTIn this guide we ll show you how to create an app where users can sign in with their GitHub and web wallet Once they are signed in we will validate if they have contributed to one of our repos and if they have we will allow the users to mint an NFT using signature based minting Before we get started below are some helpful resources where you can learn more about the tools we re going to be using in this guide View project source codeEdition contractAuthLet s get started SetupI am going to use the Next js Typescript starter template for this guide If you are following along with the guide you can create a project with the template using the thirdweb CLI npx thirdweb create next tsIf you already have a Next js app you can simply follow these steps to get started Install thirdweb dev react and thirdweb dev sdk and ethersAdd MetaMask authentication to the site You can follow this guide to add metamask auth By default the network is Mainnet we need to change it to Goerli import type AppProps from next app import ChainId ThirdwebProvider from thirdweb dev react This is the chainId your dApp will work on const activeChainId ChainId Goerli function MyApp Component pageProps AppProps return lt ThirdwebProvider desiredChainId activeChainId gt lt Component pageProps gt lt ThirdwebProvider gt export default MyApp Creating an Edition Contract and Lazy Minting An NFTLet s go ahead and deploy an Edition contract and add an NFT To do that head to the thirdweb dashboard and create an Edition contract Fill out the details and deploy the contract by clicking on Deploy Now Once the contract is deployed go to the NFTs tab and click on Mint Enter the details of your NFT and set the initial supply to Once you have filled out all the details click on Mint NFT We only want users to own NFT per wallet from this collection To achieve this we ll set our NFTs to be soulbound meaning they cannot transfer it Head to the permissions tab and set the NFTs of this collection to be Non Transferrable Setting up AuthWe need the user to sign in both with their wallet and with their GitHub account to do this we ll first set up web sign in using thirdweb then use NextAuth to add GitHub authentication thirdweb AuthFirstly we need to install the thirdweb auth package npm i thirdweb dev auth npmyarn add thirdweb dev auth yarnNow create a file called auth config ts and the following import ThirdwebAuth from thirdweb dev auth next export const ThirdwebAuthHandler getUser ThirdwebAuth Using environment variables to secure your private key is a security vulnerability Learn how to store your private key securely process env ADMIN PRIVATE KEY Set this to your domain to prevent signature malleability attacks const domain http localhost The domain is important since you don t want your users signing malicious signaturesCreate a new env local file and add a new variable named PRIVATE KEY Learn how to export your private key from your wallet Using private keys as an env variable is vulnerable to attacks and is not the best practice We are doing it in this guide for the sake of brevity but we strongly recommend using a secret manager to store your private key To configure the auth API create a new folder inside pages api called thirdwebauth and a thirdweb ts file inside it Within this file we need to export the ThirdwebHandler that we made in the config file previously import ThirdwebAuthHandler from auth config export default ThirdwebAuthHandler This will catch all the API requests that go to api auth using Next js s catch all API route syntax Behind the scenes this handles the logic for three endpoints that we re going to utilize login logout and user Finally inside the app tsx file add the authConfig prop to ThirdwebProvider lt ThirdwebProvider desiredChainId activeChainId authConfig authUrl api thirdwebauth domain example org loginRedirect gt lt Component pageProps gt lt ThirdwebProvider gt Next Auth with GitHubCreate a new folder called auth inside the pages api folder and then create a file inside auth called nextauth ts Once you have done this add the following to the file import NextAuth NextAuthOptions from next auth import GithubProvider from next auth providers github export const authOptions NextAuthOptions providers GithubProvider clientId process env GITHUB ID as string clientSecret process env GITHUB SECRET as string callbacks async session session token session id token sub return session export default NextAuth authOptions Now go to app tsx and wrap the component in a session provider like this lt SessionProvider session pageProps session refetchInterval gt lt Component pageProps gt lt SessionProvider gt The SessionProvider will be imported from next auth like this import SessionProvider from next auth react We need to add some env variables to make the auth work In the env local file add these variables GITHUB ID GITHUB SECRET NEXTAUTH URL NEXTAUTH SECRET The NEXTAUTH URL will be a link to the homepage of your website since we are working on localhost it will be http localhost To generate a secret run the following command openssl rand base Now we need to create a GitHub OAuth app You can do that from the Github Developer Settings and fill out the information like so Now copy the client id and generate a new secret and copy that Go to your env local file and update these variables Once you have filled all the env vars restart your dev server Next follow Github s Creating a personal access token guide and add this as an environment variable in your project We ll use this to make requests to GitHub s API without getting rate limited GITHUB ACCESS TOKEN Creating the login pageCreate a new file login tsx inside the pages folder and add the following import React from react import useSession signIn from next auth react import styles from styles Home module css const Login gt const data session useSession if session return lt div className styles container gt lt button className styles mainButton onClick gt signIn gt Sign in with GitHub lt button gt lt div gt export default Login This will show a Sign in with GitHub button if there is no session detected from NextAuth Now we will check for the address and thirdweb user If the user s wallet is not connected the user isn t signed in we will show the corresponding buttons Firstly we are going to need hooks const login useLogin const address useAddress const connect useMetamask Below the session check add the following if address return lt div className styles container gt lt button className styles mainButton onClick gt connect gt Connect Wallet lt button gt lt div gt return lt div className styles container gt lt button className styles mainButton onClick gt login gt Sign in with Ethereum lt button gt lt div gt This code block will first check if there is an address present If there is no address present it will show the connect wallet button otherwise the sign in with Ethereum button We are using css modules to add some basic stylings to the app so if you want to add the stylings as well Create a new folder styles and globals css inside ithtml body padding margin font family apple system BlinkMacSystemFont Segoe UI Roboto Oxygen Ubuntu Cantarell Fira Sans Droid Sans Helvetica Neue sans serif a color inherit text decoration none box sizing border box Now import it in app tsx like this import styles globals css Now create another file called Home module css and the following container width height vh display flex flex direction column justify content center align items center mainButton background linear gradient to right ffbb caff border none color fff font weight padding px px text align center text decoration none display inline block font size px margin px px cursor pointer border radius px Now we have the auth flow completed You can go to http localhost login and check it out yourself Creating the API for claimCreate a new file claim nft ts inside the pages api folder We are going to need to create an api so add the following import type NextApiRequest NextApiResponse from next const claimNft async req NextApiRequest res NextApiResponse gt if req method POST return res status json error Method not allowed return res status json message gm export default claimNft This api first checks if the request is of the post method or not and if it is using the post method we will send a message gm Now let s get into the actual code We will first get the users from the next auth and thirdweb auth like this const session await unstable getServerSession req res authOptions const thirdwebUser await getUser req if session thirdwebUser return res status json message Unauthorized We need to import them like this import unstable getServerSession from next auth next import getUser from auth config These are the two functions we use to view the authenticated user s information on the server side unstable getServerSession is our way of getting the connected Github accountgetUser is our way of viewing the authenticated wallet Now we will create a new array that will have a list of repos to check for const reposToCheck js react typescript sdk thirdweb cli contracts auth storage go sdk python sdk docs portal examples Here we have added some of our thirdweb repositories but you need to update this with your list of repositories to check Now we will loop through this array and for each item we will check if the user has contributed to them let hasContributed false for const repo of reposToCheck const contributors GithubContributor await fetch repo contributors headers Authorization token process env GITHUB ACCESS TOKEN then res gt res json const hasContributedToThisRepo contributors some contributor gt return contributor id toString session id if hasContributedToThisRepo hasContributed true Now that we know if the user has contributed or not if the user has not contributed we will simply say that you don t qualify if hasContributed return res status json message Sorry you don t qualify Now let s initialize our SDK using our private key const sdk ThirdwebSDK fromPrivateKey Using environment variables to secure your private key is a security vulnerability Learn how to store your private key securely process env PRIVATE KEY as string goerli We will first check if the user already owns one of our NFTs first const edition sdk getEdition xDcefbECFbCfCe const balance await edition balanceOf thirdwebUser address if balance gt return res status json message You already have an NFT Finally we will generate the signature to mint the NFT const signedPayload await edition signature generateFromTokenId quantity tokenId to thirdwebUser address return res status json signedPayload Our final API code will looks like this import type NextApiRequest NextApiResponse from next import unstable getServerSession from next auth next import getUser from auth config import GithubContributor from types GithubContributor import ThirdwebSDK from thirdweb dev sdk import authOptions from auth nextauth const claimNft async req NextApiRequest res NextApiResponse gt if req method POST return res status json error Method not allowed const session await unstable getServerSession req res authOptions const thirdwebUser await getUser req if session thirdwebUser return res status json message Unauthorized const reposToCheck js react typescript sdk thirdweb cli contracts auth storage go sdk python sdk docs portal examples let hasContributed false for const repo of reposToCheck const contributors GithubContributor await fetch repo contributors headers Authorization token process env GITHUB ACCESS TOKEN then res gt res json const hasContributedToThisRepo contributors some contributor gt return contributor id toString session id if hasContributedToThisRepo hasContributed true if hasContributed return res status json message Sorry you don t qualify const sdk ThirdwebSDK fromPrivateKey process env PRIVATE KEY as string goerli const edition sdk getEdition xDcefbECFbCfCe const balance await edition balanceOf thirdwebUser address if balance gt return res status json message You already have an NFT const signedPayload await edition signature generateFromTokenId quantity tokenId to thirdwebUser address return res status json signedPayload export default claimNft Creating the frontend Calling the API on the frontendGo to pages index tsx and update the return block return lt div className styles container gt lt h gt GitHub Contributor NFTs lt h gt lt p gt Claim an NFT if you have contributed to any of thirdweb amp apos s repos lt p gt address lt button className styles mainButton disabled loading onClick gt connect gt Connect to Metamask lt button gt lt button className styles mainButton disabled loading onClick mintNft gt loading Loading Claim NFT lt button gt lt div gt We are going to check if the user s wallet is connected and if it is then we will show a button to claim the NFT As you can see we are going to need a mintNFTfunction so let s create that const mintNft async gt setLoading true if networkMismatch return switchNetwork ChainId Goerli try const req await fetch api claim nft method POST const res await req json if req ok return alert Error res message await edition signature mint res signedPayload alert Successfully minted NFT catch err console error err alert Failed to mint NFT finally setLoading false We are also using some hooks to access the edition contract get the user s address connect the wallet to MetaMask store loading etc const edition useEdition xDcefbECFbCfCe const connect useMetamask const address useAddress const switchNetwork useNetwork const networkMismatch useNetworkMismatch const loading setLoading useState lt boolean gt false Now if you have contributed to any of the repositories you will successfully be able to mint the NFT Redirecting users if they are not logged inIf the user is not logged in and they come to the home page we should redirect them to login so we are going to use SSR to redirect the user if they are not logged in export const getServerSideProps GetServerSideProps async context gt const thirdwebUser await getUser context req const session await unstable getServerSession context req context res authOptions if thirdwebUser session return redirect destination login permanent false return props ConclusionIn this guide we learnt how to use thirdweb auth to allow only users who have contributed to our repos to mint an NFT If you did as well pat yourself on the back and share it with us on the thirdweb discord If you want to take a look at the code check out the GitHub Repository |
2022-09-12 05:26:18 |
金融 |
ニッセイ基礎研究所 |
貸出・マネタリー統計(22年8月)~マネタリーベースの月末残高が10年ぶりの前年割れに、異次元緩和後では初 |
https://www.nli-research.co.jp/topics_detail1/id=72323?site=nli
|
なお、末残ベースのマネタリーベース残高は、月末時点で兆円と前月末比で兆円減少している。 |
2022-09-12 14:50:30 |
金融 |
ニッセイ基礎研究所 |
ロシアGDP(2022年4-6月期)-前年同月比▲4.1%とマイナス成長に |
https://www.nli-research.co.jp/topics_detail1/id=72346?site=nli
|
また、前期比に関しても大きく落ち込んだ業種は前年同期比で落ち込んだ業種とほぼ同じだが第二次産業の「鉱業」が前期比となり、生産の急鈍化が見られる点が特徴的と言える。 |
2022-09-12 14:17:13 |
海外ニュース |
Japan Times latest articles |
With queen gone, former colonies find a moment to rethink lasting ties |
https://www.japantimes.co.jp/news/2022/09/12/world/queen-elizabeth-commonwealth/
|
With queen gone former colonies find a moment to rethink lasting tiesReconciling a seemingly benevolent queen with the often cruel legacy of the British Empire is the conundrum at the heart of Britain s post imperial influence |
2022-09-12 14:30:29 |
ニュース |
BBC News - Home |
Ukraine war: Kharkiv blackouts caused by targeted Russian attacks - Zelensky |
https://www.bbc.co.uk/news/world-europe-62873205?at_medium=RSS&at_campaign=KARANGA
|
ukraine |
2022-09-12 05:56:08 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
アップルの緊急SOS機能、衛星通信競争に口火 - WSJ発 |
https://diamond.jp/articles/-/309634
|
通信 |
2022-09-12 14:18:00 |
北海道 |
北海道新聞 |
岸田首相「沖縄県民の理解へ努力を」 普天間の辺野古移設で |
https://www.hokkaido-np.co.jp/article/729679/
|
岸田文雄 |
2022-09-12 14:19:54 |
北海道 |
北海道新聞 |
馬場咲希が日本女子オープンゴルフ出場へ 全米女子アマ覇者 |
https://www.hokkaido-np.co.jp/article/729662/
|
日本ゴルフ協会 |
2022-09-12 14:12:05 |
北海道 |
北海道新聞 |
大坂、世界ランク48位に後退 女子テニス、シフィオンテク1位 |
https://www.hokkaido-np.co.jp/article/729675/
|
世界ランキング |
2022-09-12 14:12:11 |
ビジネス |
東洋経済オンライン |
園バス置き去り「子ども」をどう守ったらいいのか 保護者は園選びで何に気をつけたらよいか? | 知っていますか? あなたの街の「保育力」 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/617850?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
東洋経済オンライン |
2022-09-12 14:30:00 |
IT |
週刊アスキー |
TGSもバカンスを満喫♪『DOA Xtreme Venus Vacation』が「コーエーテクモLIVE! in TGS2022」に出張決定 |
https://weekly.ascii.jp/elem/000/004/105/4105155/
|
dmmgamespcsteam |
2022-09-12 14:05:00 |
マーケティング |
AdverTimes |
日本広告制作協会が学生アワード開催、ANAなど3社のポスター・映像募集 |
https://www.advertimes.com/20220912/article395448/
|
作品募集 |
2022-09-12 05:04:23 |
マーケティング |
AdverTimes |
思い出と花言葉からAIで短歌を生成・共有するサイト「花と歌」公開 |
https://www.advertimes.com/20220912/article395245/
|
敬老の日 |
2022-09-12 05:03:15 |
コメント
コメントを投稿