IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] ゴルフを始めたきっかけ 3位「仕事で必要」、2位「友人のすすめ」、1位は? |
https://www.itmedia.co.jp/business/articles/2212/11/news028.html
|
itmedia |
2022-12-11 08:15:00 |
IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] 副業人材マッチング倍率9倍 「猛者」もいるのに生かせぬ大企業の現実 |
https://www.itmedia.co.jp/business/articles/2212/11/news042.html
|
itmedia |
2022-12-11 08:07:00 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
PythonとSeleniumとWebDriverとChrome拡張機能でDownload完了判定と待機(追加) |
https://qiita.com/feo52/items/bf40f1f7b6f655cf6adb
|
chrome |
2022-12-11 08:00:31 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
DockerでLibreOffice Basicマクロを実行する(2022年版) |
https://qiita.com/sonota88/items/395a32555d1187df2cc3
|
adventcalendar |
2022-12-11 08:16:25 |
Azure |
Azureタグが付けられた新着投稿 - Qiita |
1 つの Azure プライベート DNS ゾーンを 2 つの VNET から使う構成を Azure CLI で作ってみた |
https://qiita.com/mnrst/items/de9913035921e463d30d
|
azure |
2022-12-11 08:58:40 |
技術ブログ |
Developers.IO |
finch vm init 時に ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain メッセージ出力時に確認したこと |
https://dev.classmethod.jp/articles/finch-vm-init-%e6%99%82%e3%81%ab-ssh-unable-to-authenticate-attempted-methods-none-publickey-no-supported-methods-remain-%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8%e5%87%ba%e5%8a%9b%e6%99%82/
|
finchvminit時にsshunabletoauthenticateattemptedmethodsnonepublickeynosupportedmethodsremainメッセージ出力時に確認したことfinchを使ってみようとインストールしました。 |
2022-12-10 23:55:02 |
技術ブログ |
Developers.IO |
[セッションレポート] インフラストラクチャーとアナリティクスを使った人道的災害への対策計画 (IMP105) #reInvent |
https://dev.classmethod.jp/articles/reinvent2020-session-imp105/
|
impreinventaws |
2022-12-10 23:23:38 |
海外TECH |
MakeUseOf |
What Is Apple Music Sing? A Karaoke Mode for Apple Music Users |
https://www.makeuseof.com/what-is-apple-music-sing/
|
apple |
2022-12-10 23:09:39 |
海外TECH |
DEV Community |
How To Integrate Google Calendar API and friendship with Laravel. Part 2 |
https://dev.to/dnsinyukov/how-to-integrate-google-calendar-api-and-friendship-with-laravel-part-2-48ba
|
How To Integrate Google Calendar API and friendship with Laravel Part In the previous article we created a project in the Google Cloud Console as well as configured the access keys through the API In this article we ll create a project in Laravel that will authorize through Google and save access token to database You will learn the basic queries to Google via the OAuth protocol Let s skip creating the basic skeleton of a Laravel framework and start immediately with creating code to work with the Google API Creating the applicationFirst we need to install the necessary libraries to work with the API The library allows us to work with Google API Services without unnecessary actions You can also use a simple Guzzle or CURL client composer require google apiclientThe next step is to add the following variables to your env file and add configuration to services php envGOOGLE CLIENT ID from json fileGOOGLE CLIENT SECRET from json fileGOOGLE REDIRECT URI from json fileGOOGLE REDIRECT CALLBACK https localhost oauth redirect URL after fetching userinfoGOOGLE APPROVAL PROMPT forceGOOGLE ACCESS TYPE offlineservices phpreturn google gt client id gt env GOOGLE CLIENT ID client secret gt env GOOGLE CLIENT SECRET redirect uri gt env GOOGLE REDIRECT URI redirect callback gt env GOOGLE REDIRECT CALLBACK scopes gt Google Service Calendar CALENDAR EVENTS READONLY Google Service Calendar CALENDAR READONLY Google Service Oauth OPENID Google Service Oauth USERINFO EMAIL Google Service Oauth USERINFO PROFILE approval prompt gt env GOOGLE APPROVAL PROMPT force access type gt env GOOGLE ACCESS TYPE offline include granted scopes gt true OAuth processAfter creating and setting up our service we need to log in through the OAuth process To do that we need to generate auth URL and redirect the user to the Google OAuth server to begin the authentication and authorization process You can use OAuth Scopes for Google APIs The first column indicates the name of the scope a list of which we have defined in the settings Google will require consent for each when you authorize In our services php we requested permission to openidhttps www googleapis com auth userinfo emailhttps www googleapis com auth userinfo profilehttps www googleapis com auth calendar events readonlyhttps www googleapis com auth calendar readonly Google as a DriverWe ll create a service to work with the Google API that will complement and encapsulate the way the app works and add some polymorphism to it A little later we will expand the work of calendars to other providers such as Outlook Create a Marker Interface Tag Interface In the future we will supplement it with the necessary methods Marker Interfaces are empty interfaces i e they do not have any variables or methods declared in them interface ProviderInterface Polymorphism will help us create an adaptive application Let s create a basic service to work with all popular calendars abstract class AbstractProvider implements ProviderInterface protected providerName protected request protected httpClient protected clientId protected clientSecret protected redirectUrl protected scopes protected scopeSeparator protected user Create a new provider instance public function construct Request request string clientId string clientSecret string redirectUrl array scopes this gt request request this gt clientId clientId this gt redirectUrl redirectUrl this gt clientSecret clientSecret this gt scopes scopes return RedirectResponse throws Exception public function redirect RedirectResponse this gt request gt query gt add state gt this gt getState if user this gt request gt user this gt request gt query gt add user id gt user gt getKey return new RedirectResponse this gt createAuthUrl return User public function getUser User if isset this gt user return this gt user try credentials this gt fetchAccessTokenWithAuthCode this gt request gt get code this gt user this gt toUser this gt getBasicProfile credentials catch Exception exception report exception throw new InvalidArgumentException exception gt getMessage state this gt request gt get state if isset state state Crypt decrypt state return this gt user gt setRedirectCallback state redirect callback gt setToken credentials access token gt setRefreshToken credentials refresh token gt setExpiresAt Carbon now gt addSeconds credentials expires in gt setScopes explode this gt getScopeSeparator credentials scope abstract protected function createAuthUrl abstract protected function fetchAccessTokenWithAuthCode string code abstract protected function getBasicProfile credentials abstract protected function toUser userProfile Our first implementation will be a service for the work of Google let s create it class GoogleProvider extends AbstractProvider protected providerName google public function createAuthUrl string return this gt getHttpClient gt createAuthUrl public function redirect RedirectResponse if redirectCallback config services google redirect callback this gt request gt query gt add redirect callback gt redirectCallback return parent redirect protected function fetchAccessTokenWithAuthCode string code array return this gt getHttpClient gt fetchAccessTokenWithAuthCode code return array protected function getBasicProfile credentials jwt explode credentials id token Extract the middle part base decode it then json decode it return json decode base decode jwt true param Userinfo userProfile return void protected function toUser userProfile return tap new User function user use userProfile user gt setId userProfile sub user gt setName userProfile name user gt setEmail userProfile email user gt setPicture userProfile picture return Client protected function getHttpClient Client if is null this gt httpClient this gt httpClient new Google Client this gt httpClient gt setApplicationName config app name this gt httpClient gt setClientId this gt clientId this gt httpClient gt setClientSecret this gt clientSecret this gt httpClient gt setRedirectUri this gt redirectUrl this gt httpClient gt setScopes this gt scopes this gt httpClient gt setApprovalPrompt config services google approval prompt this gt httpClient gt setAccessType config services google access type this gt httpClient gt setIncludeGrantedScopes config services google include granted scopes Add request query to the state this gt httpClient gt setState Crypt encrypt this gt request gt all return this gt httpClient The only thing missing is a manager to work with our service Now we can safely inherit from our base class AbstractProvider and implement new drivers use Illuminate Support Manager class CalendarManager extends Manager protected function createGoogleDriver ProviderInterface config this gt config gt get services google return this gt buildProvider GoogleProvider class config protected function buildProvider provider config ProviderInterface return new provider this gt container gt make request config client id config client secret config redirect uri config scopes The business logic for getting the data about the Google user and access tokens is almost ready All that remains is to test it in a live environment All that s left to do is make our services accessible by creating new routes and controllers Route name oauth auth gt get oauth provider AccountController class auth Route name oauth callback gt get oauth provider callback AccountController class callback The provider parameter will be dynamically inserted and checked against the CalendarManager class Let s start by redirecting the user to the Google consent screen using AccountController auth function Click on the link https localhost oauth google public function auth string driver RedirectResponse try return app CalendarManager class gt driver driver gt redirect catch InvalidArgumentException exception report exception abort exception gt getMessage The CalendarManager will find the right provider from the URL and create the necessary driver to work with Google and will send a request for an authorization grant Step As soon as the user logs in and agrees with the scopes of our app reading profile email calendars events they are redirected back to our AccountController callback which we specified in the env file we get a code in the body of our response from the Google Auth server The getUser method based on the code will request an access token and a refresh token with which we can retrieve the data public function getUser credentials this gt fetchAccessTokenWithAuthCode this gt request gt get code Next the access token allows you to request private info step At the first request we need to get information about the owner of the account his name email and ID this gt user this gt toUser this gt getBasicProfile credentials We encode the access token and refresh tokens via jwt and store them in the database along with the profile data The JWT token will store all token validity information public function encode array payload string config config app tokenId base encode random bytes issuedAt new DateTimeImmutable jwtPayload iat gt issuedAt gt getTimestamp jti gt tokenId iss gt config name nbf gt issuedAt gt getTimestamp exp gt payload expires at gt getTimestamp data gt access token gt payload access token refresh token gt payload refresh token provider gt payload provider scopes gt payload scopes email gt payload email account id gt payload account id return JWT encode jwtPayload config key this gt alg And save everything in the database for later use Schema create oauth accounts function Blueprint table table gt id table gt string account id table gt string name table gt string email gt index table gt string picture table gt string provider gt nullable table gt unsignedBigInteger user id gt nullable table gt text token gt nullable table gt dateTime expires at gt nullable table gt timestamps UserService php public function saveFromUser User user string provider payload account id gt user gt getId email gt user gt getEmail name gt user gt getName picture gt user gt getPicture provider gt provider access token gt user gt getAccessToken refresh token gt user gt getRefreshToken scopes gt implode user gt getScopes expires at gt user gt getExpiresAt created at gt now updated at gt now payload token this gt encrypter gt encode payload unset payload access token payload refresh token payload scopes if DB table oauth accounts gt where account id payload account id gt where provider provider gt exists unset payload created at DB table oauth accounts gt where account id payload account id gt where provider provider gt update payload else DB table oauth accounts gt insert payload Bottom LineIn this article we created the application and the driver to work with the Google API as well as authorized the user through OAuth from Google and got tokens to access the server We will need tokens to get data at any time This approach will allow us to use access to API in any application be it WEB or mobile You can find the full source code in the Laravel package at the GitHub Related linksHow To Integrate Google Calendar API and friendship with Laravel Part |
2022-12-10 23:39:32 |
海外TECH |
DEV Community |
How I use Notion as a Software Developer |
https://dev.to/zt4ff_1/how-i-use-notion-as-a-software-developer-36fh
|
How I use Notion as a Software DeveloperI have spent a lot of time watching a lot of Notion content on Youtube and I even read a bit of the Notion API Documentation to see if there s any way I can integrate Notion into my existing workflow Ever since I discovered Notion it has become a productive tool I use almost every day Everything in Notion is a block that can be texts images videos links headings etc and can be transformed into another type of block or rearranged in any way that may suit your needs Personal DashboardI created a personal dashboard to manage myself my work my learnings my library etc This is like a homepage that is shown to me whenever I open up Notion Trust me I don t use Notion in light mode I used to have this dashboard open on an extra monitor so I thought it can be a bit aesthetic by showing a clock and auto generated quote images The clock and auto generated quotes images are widgets created using indify co Note taking AppNotion is always my go to app for note taking I find the markdown support extremely useful as a developer to write notes faster Notion supports syntax colouring for over programming languages making it a good utility for developers It provides some features that I really find helpful for note taking It is cross platform can share notes with the public and also invite private collaboration Technical WritingI manage a Notion database for articles and write my drafts using Notion Because of my familiarity with markdown and the speed to use any block type on Notion I am able to focus more on writing while things like formatting link insertions etc happen from muscle memory Notion database is handy for project management This is a screenshot of how I manage my article writing workflow I am able to use tags to keep track of the article status and ownership and also sort the data based on the deadline ownership and status of the article I also had the table configured to remove published items from the table view I am currently researching ways to improve my blogging workflow using Notion API I am open to recommendations and collaboration please Wrap UpThat is a quick overall of how I use Notion in my workflow as a developer I hope you are able to get new ideas from my workflow and able to find new ways to incorporate Notion into your workflow too Kindly share how you use Notion too so we have plenty of inspirations to choose from Let s connect on Twitter whatcha say |
2022-12-10 23:20:31 |
Apple |
AppleInsider - Frontpage News |
Twitter Blue will cost $11 per month for iOS app subscribers |
https://appleinsider.com/articles/22/12/10/twitter-blue-will-cost-11-per-month-for-ios-app-subscribers?utm_medium=rss
|
Twitter Blue will cost per month for iOS app subscribersElon Musk isn t giving up on Twitter Blue with the subscription confirmed to be returning at per month through a browser but via the iOS app Verification issues were the downfall of Twitter Blue last time The continued attempts by Twitter to bring in more revenue from users has already seen changes to its Twitter Blue subscription followed by its abandonment Now it s confirmed to be coming back on Monday with it being more expensive on iOS Read more |
2022-12-10 23:21:39 |
Apple |
AppleInsider - Frontpage News |
Grab a 14-inch MacBook Pro for just $1,574 with B&H's Payboo Card |
https://appleinsider.com/articles/22/12/10/grab-a-14-inch-macbook-pro-for-just-1574-with-bhs-payboo-card?utm_medium=rss
|
Grab a inch MacBook Pro for just with B amp H x s Payboo CardTime is running out to score back in addition to a sales tax refund on multiple MacBooks including Apple s inch MacBook Pro with B amp H s Payboo Card Get back on select items with Payboo B amp H s holiday Payboo promotion offers readers back on numerous Apple products including the standard inch MacBook Pro Read more |
2022-12-10 23:09:40 |
海外ニュース |
Japan Times latest articles |
Recipe: Kakiage soba |
https://www.japantimes.co.jp/life/2022/12/11/food/japanese-kitchen-kakiage-soba/
|
japanese |
2022-12-11 08:00:58 |
ニュース |
BBC News - Home |
Kenya Maasai Olympics: Hundreds gather for lion hunt alternative |
https://www.bbc.co.uk/news/world-africa-63932225?at_medium=RSS&at_campaign=KARANGA
|
kenya |
2022-12-10 23:23:24 |
ニュース |
BBC News - Home |
England: 'A brutal outcome as Three Lions exit feels even more painful' |
https://www.bbc.co.uk/sport/football/63932074?at_medium=RSS&at_campaign=KARANGA
|
England x A brutal outcome as Three Lions exit feels even more painful x As England exit the World Cup at the quarter final stage BBC Sport s Phil McNulty says this loss feels even more painful than those of previous tournaments |
2022-12-10 23:18:59 |
ニュース |
BBC News - Home |
World Cup 2022: England manager Gareth Southgate to 'reflect and review' position after loss |
https://www.bbc.co.uk/sport/football/63931761?at_medium=RSS&at_campaign=KARANGA
|
World Cup England manager Gareth Southgate to x reflect and review x position after lossEngland manager Gareth Southgate says he will review and reflect on his side s World Cup quarter final exit with the FA before making a decision on his future |
2022-12-10 23:17:03 |
ニュース |
BBC News - Home |
World Cup 2022: 'We witnessed history as Morocco won' |
https://www.bbc.co.uk/news/world-middle-east-63930050?at_medium=RSS&at_campaign=KARANGA
|
finals |
2022-12-10 23:00:51 |
ビジネス |
プレジデントオンライン |
なぜキーエンス社員は平均年収2183万円を稼げるのか…仕事の価値を高めるために必要な「3つの問い」 - ムダな仕事が報酬につながらないのは当たり前 |
https://president.jp/articles/-/64232
|
当たり前 |
2022-12-11 09:00:00 |
コメント
コメントを投稿