IT |
気になる、記になる… |
AppleのAR/VRヘッドセットのOSは「rOS」に?? − 「iOS 16」や「macOS 13」などのコードネームも明らかに |
https://taisy0.com/2022/01/03/150380.html
|
apple |
2022-01-03 12:35:57 |
IT |
気になる、記になる… |
Belkin、「Amazon 初売り」で50製品以上を最大半額で販売するセールを開催中 − LinksysのWi-Fiルーターも対象 |
https://taisy0.com/2022/01/03/150377.html
|
amazon |
2022-01-03 12:21:10 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
【画像処理】Numpyで幾何学的変換 |
https://qiita.com/aa_debdeb/items/c85fc4c0511bac519881
|
beginpmatrixampamptxampamptyampampendpmatrixdeftranslatexyreturnnparrayxy平行移動を適用します。 |
2022-01-03 21:44:41 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
urllib.parse.urlparseについて |
https://qiita.com/mino-38/items/452f4e9b525a69be0e3c
|
|
2022-01-03 21:15:08 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
LocomotiveScroll と ScrollTriggerを連携させる |
https://qiita.com/komugichan/items/51542505b97b1f891985
|
locoScrollonscrollScrollTriggerupdateSmoothScrollがonになるとLocomotiveScrollがスクロールを制御するようになるため、elで指定した部分で色々な高さの調整が行われますので、ScrollTriggerでもそのproxyを使用するようにします。 |
2022-01-03 21:17:31 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
MQL4でエラー【Array out of range】が出てきて困っています |
https://teratail.com/questions/376494?rss=all
|
MQLでエラー【Arrayoutofrange】が出てきて困っていますMQLでエラー【Arraynbspoutnbspofnbsprange】が出てきて困っていますソースコード下記は本ソースではないですが同じようなところでエラーが出るので簡潔にするために作成したテストコードです。 |
2022-01-03 21:54:11 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
DynamoDBをこうやって理解しよう |
https://qiita.com/kobashi-yoshizumi/items/9c1ad7a8b8e313186134
|
DBはつじゃないのここがDynamoDB理解の肝なのですが、使用されるレコードはつの物理的なユニットに全部収められているのではなく、パーティションの値次第で物理的に別のDBに納められている模様いや、実際にAMAZONの社内で調べたわけではないけど、そうゆう話が流布されてます。 |
2022-01-03 22:00:06 |
Docker |
dockerタグが付けられた新着投稿 - Qiita |
Docker+GPU環境でESPnet2を使用する |
https://qiita.com/tatefuku_hiroshi/items/fee4fa4451740da73969
|
ここで重要なのは使用するdockerイメージのバージョンです。 |
2022-01-03 21:02:00 |
GCP |
gcpタグが付けられた新着投稿 - Qiita |
【備忘】GKEからコンテナに対して環境変数を渡す |
https://qiita.com/Quasar9/items/e4b575ca4d992a624d25
|
KubernetesEnginegtgtワークロードgtgt対象のワークロードを選択gtgtYAMLタブをクリック編集モードでデプロイメントのyamlにenv以下を設定して保存するspeccontainersenvnameAPPLICATIONENVvalueFromconfigMapKeyRefkeyAPPLICATIONENVnameenvconfig以上で環境変数をコンテナが読み込める。 |
2022-01-03 21:06:14 |
海外TECH |
DEV Community |
How to create usable and maintainable npm packages |
https://dev.to/yakovlev_alexey/how-to-create-usable-and-maintainable-npm-packages-4m53
|
How to create usable and maintainable npm packagesOpen source era is upon us Many day to day problems that developers meet already have open source solutions on the web When encountering an issue we instinctively first search the web for ready made solutions and make attempts at adopting them However how often do you find existing solutions clunky poorly documented unmaintained and unmaintainable For me it is a common situation when I end up creating a solution of my own Lately I have also started making those solutions open source and available to everyone When doing so I started thinking about ways I can make my solutions more user friendly than others And I ended up with a list of things I look for when creating a new npm package a sort of check list of prerequisites to publish a package So how can you make your npm packages more maintainable and usable As a disclaimer I should say that I am mostly talking about small to medium npm packages that are quickly developed to solve a small ish problem Larger packages are a domain of their own and out of scope of this post DocumentationIt seems very obvious and basic but how often do you stumble upon a package that has a very basic or outdated README or no README at all Such packages are mostly useless to users As an engineer of a solution it is your responsibility to provide sufficient documentation on how to employ a tool of your creation But what should be sufficient Analysing my usage of npm packages I discovered that it is best to start with a small introduction of your package what it does what it helps to achieve For example package nest next starts by saying that it is a Render Module to add Nextjs support for Nestjs This is an example of a good short description that would come up in search Also do not forget to add this description to your VCS hosting likely GitHub and package json so that it comes up in search better The actual README file could have a more detailed introduction Having a Table of Contents helps greatly Allow readers to quickly scan contents of your README by providing a list of sections with relevant names and anchors Try not to have a very long list of items and do not overextend your introduction Table of Contents should be immediately visible when opening a README When the list becomes very large more than approximately items it either means that you should reduce the amount of items or that you are dealing with a bigger package and should split up your README in separate docs or a whole website Continue with installation instructions Which peer dependencies should you install Maybe there are certain prerequisites and engine limitations State it there and supply readers with installation snippets that are easy to copy Finally instruct users on actual usage How do you employ your tool Where do you configure it What configuration options are available How to import it s entities Maybe there are certain features that are not yet implemented or behave unexpectedly How is your solution different to similar ones Try to fit the most important things without turning your README into a JSDoc focus on actual usage and recipes without implementation details Perhaps leave a link to a project of your own that employs this package as an example It would also be nice to tell readers where to leave feedback or submit enhancements Invite users to leave GitHub Issues or submit a Pull Request with relevant links This is also the time to acknowledge other packages that might have inspired you Do not forget to leave keywords and VCS links in your package json And obviously always include README in your published files Managing codeOnce again it s fairly obvious to make your code readable However some of the more popular packages tend to have all the code in a single file with a mixed bag of code styles Other packages overengineer solutions Strike a balance between the two Employ type checking to make your code safer to change You might not even use TypeScript or actual ts files You may use JSDoc typings and JS checks to leverage some type safety without need to compile your code I used this strategy in one of my packages and found it really useful And having types through TypeScript annotations or JSDoc is a must for any exported functions Never write all the code in a single file Create separate files for functions maybe even folders for different types of functions and classes Try not to add any dependencies to your project unless they are peer or likely to be reused in users node modules Use bundlephobia to track your package size Do not invest in automatic tests This might seem counterintuitive but I find spending time on unit tests for small packages wasteful Unless your package is a unit of itself a simple function or class with clear inputs and outputs While TDD and unit tests are amazing for product development I find them fairly useless due to nature of small to medium packages that are either never changing or ever changing forcing you to endlessly update tests instead of focusing on the solution to the problem at hand This obviously changes for larger packages and packages with huge user bases but it is not often you create one to solve a day to day problem Do not employ powerful and hard to configure tools to build and develop your project Leave a basic editorconfig file to keep codestyle under control for tiny packages Do not minify your sources it will not give a significant enough difference for small packages It is far better to install a package with less dependencies than a package with minified sources For most compilation needs Microsoft TypeScript Compiler tsc should do the job Perhaps do not transpile your code at all Keep your package json clean State all the required snippets in scripts section Specify a valid engines property Use a valid main or module field and include only necessary files dist folder or index file README and LICENSE files And perhaps most importantly properly specify package dependencies peer dependencies should be peer and no dev deps should be in actual dependency list It is also helpful to have a readable commit log Packages with a single commit in VCS do not look very reliable Great commit history also helps when discovering code through blame Remember that it is impossible make a solution to all the problems To conclude this section your code should do two things solve the desired problem and no other problem with as little dependencies as possible be easy to extend or modify so that users can easily alter your solution to suit their goals VersioningAnother simple thing that is somehow hard to get right Always employ Semantic Versioning Invest in making your commits both human and machine readable Conventional Commits can help you with that It is not uncommon to find a package maintainer who would accept your contribution and then forget to publish a new version of their package To make sure that it never happens with you create a basic CI workflow that would automatically manage versions and publish your package according to newly pushed commits to VCS But do not use external services for CI GitHub Actions and GitLab CI would suffice Luckily such workflows are largely reusable and I have a few public Gists with GitHub Actions workflows for different types of projects More serious project with tests and linting may employ this multi stage workflow and smaller packages would be fine with a simple publish on push workflow Both workflows employ bump package version action of my own check documentation for more details on it Be a humanJust that Respect your users respond to issues with manners and in a reasonable time discuss enhancements with contributors and with detailed feedback Focus not on having a package that you think works but on a package that solves users problems and respects their opinion Remember that your goal is not to have the most popular package Your goal should be collaborating on creating the best possible tool to solve a problem Even if someone discovered a better solution as a fork of yours do not be mad at them ask them if there is a way to integrate their solution into yours ConclusionLet s rewind all the things I stated to a more concise list When creating a npm package do create documentation for the userprovide the user with installation and usage instructionswarn the user of known issues and limitationsleave a link to your VCSinvite users to leave feedback and contributionstype check your codeprovide types for exported entitieskeep dependencies up to datestrive to have a smaller packagecreate a readable and extendable codeemploy Semantic Versioningfollow Conventional Commitsautomate versioning and publishingrespect and collaborate with usersAnd do not publish a package with an insufficient or without a READMEcreate a JSDoc out of your READMEleave users without links to source codewrite the code in a single fileoverengineer solutionsinvest in unit tests unless your package is a unit of its own solve more than one problem at a timerelease breaking changes without major versionsadd unnecessary dependenciesforget to publish latest versionsargue with your users about functionalityDo you agree with this list Perhaps you find some points unreasonable or have something to add Do you even believe in the open source itself and the future being largely open source Be welcome to discuss in the comments |
2022-01-03 12:37:03 |
海外TECH |
DEV Community |
How To Customize Super Tokens APIs. |
https://dev.to/tyaga001/how-to-customize-super-tokens-apis-1gm6
|
How To Customize Super Tokens APIs Last month I got a chance to explore SUPERTOKENS an open source alternative to Auth Firebase Auth and AWS Cognito SuperTokens enables easy customizations all within your codebase They built API overrides which empowers devs to disable and modify any SuperTokens API Auth requirements are quite varied Therefore any auth solution must provide the ability to customise their APIs Each solution uses its own terminology for this feature Keycloak uses “Implementing a SPI Auth calls these “Auth actions Firebase calls these “Extend using cloud functions AWS Cognito uses the term “Lambda triggers amp Custom challenge SuperTokens calls this feature “Overrides These features allow you to change the default behaviour of the auth APIs by Creating an HTTP webhook in your API layer which is then called by the auth providerUploading code to the auth provider for example JS code for Auth or Java interface implementation for Keycloak which run at specific points in the API s logic Uploading code to the auth provider which can replace the existing API s logic entirely as opposed to just running at specific points in the API How powerful these solutions are depends on The auth provider providing the right “hook points in their API where your custom code can run Your familiarity with the programming language you need to use to write the custom code How easily your custom code can integrate with your existing infrastructure code for example database connection setup and how easily it can be maintained for example you may need to maintain the custom code snippets in your git repo as well as on the auth provider s dashboard In this article we will be talking about how to customise the auth APIs provided by SuperTokens using its “Override feature In order to understand that we must first understand how SuperTokens fits within an app SuperTokens architecture Here we can see the architecture diagram for the self hosted version of SuperTokens On the left we have the client browser mobile app which talks to your APIs Your API layer has your application APIs shown as api api and also APIs automatically exposed by the SuperTokens backend SDKs via our middleware function shown as auth signin auth signout The SuperTokens APIs talk to the SuperTokens Core HTTP microservice to persist data in the database Your application APIs can also talk to the core if needed Keeping this in mind the concept of override is that you can change the behaviour of the SuperTokens APIs exposed to the frontend as per your requirements all within your API layer in the language you already use Think of this being similar to overrides in object oriented programming where you have an original implementation and you can modify its behaviour by overriding the existing functions You can even call the “super class implementation of that function in your override function Overriding feature in SuperTokens Whilst this article is focused on a NodeJS backend the concepts here are very similar to all the other backend SDKs provided by SuperTokens To override the default implementation we must use the override config value when calling supertokens init Each recipe inside the recipeList accepts an override config that can be used to change the behaviour of that recipe In the above we have defined the skeleton code for how to override the behaviour of the EmailPassword recipe A very similar skeleton is applicable for overriding the Session or any other recipe There are two types of override APIs These govern how the APIs exposed by that recipe behave For EmailPassword these are the sign in sign up reset password and email verification APIs By overriding these you can change how these APIs behave when they are called from the frontend Functions These are the functions that govern how the recipe itself behaves They can be called by you manually in your APIs and they are also used in the APIs we expose to the frontend By default they query the SuperTokens core and return its response The difference between the two are API functions have access to the request and response objects depending on the web framework being used API functions can call several recipe functions or even call functions from multiple recipes For example the signInPOST API function in the EmailPassword recipe calls the signIn recipe function from EmailPassword recipe and the createNewSession function from the Session recipe You always want to try and use the override functions config since that will make the minimum change to the default behaviour If the inputs to those functions don t suffice for your use case then you should override the APIs In both these types of overrides they accept the originalImplementation variable as an input and the return is an object that has the same type as the originalImplementaion For EmailPassword recipe the originalImplementation object contains For function override see full type def here signInsignUpupdateEmailOrPasswordcreateResetPasswordTokenresetPasswordUsingTokengetUserByEmailgetUserById For API override see full type def here signInPOSTsignUpPOSTemailExistsGETgeneratePasswordResetTokenPOSTpasswordResetPOSTFor Session recipe the originalImplementation object contains For function override See full type def here createNewSessiongetAccessTokenLifeTimeMSgetAllSessionHandlesForUsergetRefreshTokenLifeTimeMSgetSessiongetSessionInformationrefreshSessionrevokeAllSessionsForUserrevokeMultipleSessionsrevokeSessionupdateAccessTokenPayloadupdateSessionData For API override see full type def here refreshPOSTsignOutPOSTIn the code snippet above we are not modifying the default behaviour of any of these functions since we are simply returning the originalImplementation object If you want to modify the signIn function then we can do so like this In the above code snippet we have provided a custom signIn function that uses the original implementation s signIn function As marked above in TODO comments we can write custom logic before or after calling the original implementation If we wish we can even avoid calling the original implementation entirely and define our own logic For example if we wanted to use a different password hashing algorithm that is not supported by SuperTokens Special cases for modifying APIs Sometimes you may want to modify the default API to Access the request object for example to read the origin header Send a custom reply to your frontend UI that deviates from our predefined output typesDisable an API we have provided entirely For example you may want to do this if you do not want users to self sign up in your application The function signature of all the API interface functions has an options parameter that contains the original request and response objects You can read from the request object and write to the response object as you normally would in your own APIs For example if you want to read the request s origin header during the sign up API you can do it as follows As you can see above we can access the request object using input options req Likewise if we want to send a custom response to the frontend we can access the response object via input options res Finally to disable an API that we provide you can set it to undefined as follows This will disable the sign up API and requests to auth signup will be passed along to your APIs or yield a Advantages of the override method Make modifications in the language and web framework you are already familiar with within your own backend layer This allows you to reuse your code for connecting to your database sending a custom reply logging requests and responses sending analytics events handling errors etc Furthermore since you already know the language and the web framework the learning curve is minimal Easier maintainability Some auth providers require you to upload code onto their dashboard This means you need to make sure that changes to that version of the code in your git repo are reflected on the auth provider s dashboard and vice versa This can be a headache especially with larger team sizes With SuperTokens all the mods you will ever need will live in the same codebase as all of your other backend code SuperTokens is just another library you use Flexibility in customisations If you noticed we don t provide any special “hook points like pre sign up or post sign up callbacks You simply create your own implementation based on the original implementation In fact you can even copy the original implementation s code and paste that in your own implementation if required Hence your modifications can be at any point in the API logic In turn this provides maximum flexibility Flexibility in integrations Auth APIs have to interact with several other services like those used for sending emails or SMSs spam anomaly detection or rate limiting Since the APIs are all within your own backend layer you can use any such service s in the APIs we provide you are not limited to the ones we eventually will support Conclusion In the post we saw how we can use the Overrides feature to modify the behaviour of any of the auth APIs exposed by SuperTokens Whilst this blog focuses on NodeJS the concept is the same in all the other SDKs we provide That was it for this blog I hope you learned something new today If you did please like share so that it reaches others as well In case you have any questions please join our discord server We are building an open source alternative to Auth Firebase Auth amp AWS Cognito We are open source You can easily customize any part of the user auth logic within your own backend layer Note this features is available for the self hosting version of ST as well Follow supertokensio for more technical content I wrote a blog past in Nov in which I explained everything what I see in ST check here Let me know how you will use SuperTokens to create your next project Connect with me on Twitter If you like this I encourage you all to sign up for my newsletter It s free You can ask me your questions via email Check out old editions here The Developer Growth Newsletter by Ankur Also if you want to talk about SuperTokens have questions please shoot a DM on Twitter here |
2022-01-03 12:30:03 |
海外TECH |
DEV Community |
Quasar admin CRM with Quasar 2! |
https://dev.to/mayank091193/quasar-admin-crm-with-quasar-2-5c78
|
Quasar admin CRM with Quasar I have migrated my Quasar Admin CRM template to Quasar I am offering it at the cheap price of If you want to purchase please send me an email at mayank gmail comLive demo Do let me know in case of any questions |
2022-01-03 12:02:43 |
Apple |
AppleInsider - Frontpage News |
Samsung's 2022 monitors boast USB-C, mini LED backlight, smart TV apps |
https://appleinsider.com/articles/22/01/03/samsungs-2022-monitors-boast-usb-c-mini-led-backlight-smart-tv-apps?utm_medium=rss
|
Samsung x s monitors boast USB C mini LED backlight smart TV appsSamsung s lineup of monitors for includes the Smart Monitor M with built in smart TV apps the High Resolution Monitor S aimed at professionals and the curved Odyssey Neo G with a Hz refresh rate Samsung Odyssey Neo GSamsung typically has a strong showing of monitors during CES revealing its launches for the year ahead For Samsung is keeping up the tradition highlighting a trio of display series that could interest Mac users Read more |
2022-01-03 12:10:26 |
海外TECH |
Engadget |
The Morning After: Tech that helps with those New Year’s resolutions |
https://www.engadget.com/the-morning-after-tech-that-helps-with-new-years-resolutions-121506947.html?src=rss
|
The Morning After Tech that helps with those New Year s resolutionsWelcome to the new year How are those resolutions coming along Don t worry we can help Contrary to my expectations CES is still happening However the organizers have announced that the tech show will be cut short by a day as COVID cases continue to surge It s also kind of started early with some big announcements from Samsung already including putting NFTs into its TVs and an upgraded eco TV remote that sips on your WiFi waves for energy Expect a week of hardware announcements even if chances to play with and assess these new devices are a little limited without attendance in person Mat SmithAlienware s Concept Nyx is like a Plex server for your PC gamesBut will it appeal to anyone beyond PC gaming fanatics Alienware s newest concept can be boiled down to a gaming server that runs on your home network You could conceivably run two games at once on your television as Engadget saw during a recent demo in NYC Since all of the rendering and network processing is happening in your home Nyx would also be a lower latency experience than traditional cloud gaming Continue reading This is a shiatsu hand massager for gamersA hand warmer setting may help you get good BauhutteTo help soothe their weary mitts Japanese company Bauhutte has created a hand massager for gamers The device works on either hand and has a layer airbag for each finger and a shiatsu plate for the palm There are two main options a Shiatsu mode for the entire hand and one that focuses on stretching fingers Continue reading The next AirPods Pro might support lossless audioYou might have an easier time finding your case too Now that the third generation AirPods offer some of the same features as the AirPods Pro how will Apple s higher end wireless earbuds stand out Analyst Ming Chi Kuo claims Apple is launching its second generation Pro earbuds in the fall with support for Apple Lossless ALAC audio Kuo expects the updated headphones will offer a quot new form factor design quot and that the new buds will supposedly include a charging case that can make sounds much like AirTags to help find it behind your couch cushions Continue reading Samsung s latest remote turns router radio waves into energyThe Eco Remote has a white option to match Samsung s lifestyle TVs SamsungSamsung has revamped the solar charging remote it debuted at last year s CES Along with using light to top up the battery Samsung says the latest Eco Remote can convert routers radio waves into energy to stay fully charged There s still a solar panel on the rear of the remote which is also made with recycled materials nbsp Continue reading Twitter bans Marjorie Taylor Greene s personal accountDue to repeatedly spreading COVID misinformation Twitter has banned Georgia Representative Marjorie Taylor Greene s personal account after a fifth quot strike quot for spreading COVID misinformation A fifth strike means it s a permanent ban In the past year she claimed in July that COVID wasn t dangerous unless you were over or obese and in August said vaccines were quot failing quot against the new coronavirus Delta variant Both statements were untrue The posts respectively led to hour and one week suspensions Her official account is still active as of this writing because it hasn t run afoul of Twitter s rules Beyond that she may have to wait around for TRUTH Social to finally launch Continue reading nbsp nbsp The biggest news stories you might have missedThe tech industry s accessibility report card for Netflix will be required to stream state TV channels in RussiaSamsung s QLED TVs include the first Hz K and K setsTech that can help you stick to your New Year s resolutionsAnd the biggest losers in tech in are Samsung is putting NFTs in its smart TVsSquare Enix is investing in decentralized blockchain games |
2022-01-03 12:15:06 |
海外TECH |
WIRED |
Could Being Cold Actually Be Good for You? |
https://www.wired.com/story/could-being-cold-actually-be-good-for-you
|
benefits |
2022-01-03 13:00:00 |
海外TECH |
WIRED |
Welcome to the New WIRED |
https://www.wired.com/story/welcome-to-the-new-wired
|
wiredthe |
2022-01-03 13:00:00 |
ニュース |
BBC News - Home |
Covid: Classroom masks in England for no longer than necessary, Nadhim Zahawi says |
https://www.bbc.co.uk/news/uk-59854920?at_medium=RSS&at_campaign=KARANGA
|
education |
2022-01-03 12:03:45 |
ニュース |
BBC News - Home |
Hospitals in Lincolnshire declare critical incident |
https://www.bbc.co.uk/news/uk-england-lincolnshire-59858887?at_medium=RSS&at_campaign=KARANGA
|
absences |
2022-01-03 12:38:27 |
ニュース |
BBC News - Home |
Covid jab for five to 11-year-olds in Ireland |
https://www.bbc.co.uk/news/world-europe-59857507?at_medium=RSS&at_campaign=KARANGA
|
coronavirus |
2022-01-03 12:48:01 |
ニュース |
BBC News - Home |
The Ashes: Joe Root says England can 'stand up in adversity' |
https://www.bbc.co.uk/sport/cricket/59838330?at_medium=RSS&at_campaign=KARANGA
|
australia |
2022-01-03 12:50:00 |
LifeHuck |
ライフハッカー[日本版] |
【Amazon初売り】パーティーゲームがお買い得!モノポリーが47%オフ、ジェンガが51%オフなど |
https://www.lifehacker.jp/2022/01/amazon-timesale-hatsuuri-2022-0103-4.html
|
amazon |
2022-01-03 21:15:00 |
北海道 |
北海道新聞 |
ロシア、新規感染者が減少 1日当たり1万6千人 |
https://www.hokkaido-np.co.jp/article/629732/
|
新型コロナウイルス |
2022-01-03 21:02:00 |
コメント
コメントを投稿