js |
JavaScriptタグが付けられた新着投稿 - Qiita |
[MV3] Chrome Extension 開発の教訓 |
https://qiita.com/ichitose/items/336bf5adb0fe3a985947
|
chrome |
2022-04-25 05:11:57 |
海外TECH |
DEV Community |
Introducting Lightship 0.1.0 |
https://dev.to/khalyomede/introducting-lightship-010-3834
|
Introducting Lightship Hello and welcome to my new article where I would like to showcase my newest open source project Lightship PHP How it startedDoubtsUsage exampleWhat s next How it startedIt all started from a Tweet where I was asking the Laravel community if folks would be interesting in a command line tool to facilitate running Google Lighthouse reports for their routes Anwar anwar nairi Laravel community would you be interested I made this for my own app it lacks details heavy WIP PM Jan This tweet stimulated the comments section and it gave me the will to go and start creating a package for the community DoubtsI like to challenge myself as if I was a user of the package So I asked myself if the package was easy to use and turns out I had spent a few hours struggling to install Google Chrome headless and setting it up so that I could call it from my package I use Docker This was the first thing that made me re think the success of this project After a little chat with my brother Amin because we have great discusses and these chats always gives me good feedbacks to keep challeging myself we started to imagine What if we did not had to use a web browser to get a web page audit So I started fiddling with some prototypes using pure HTTP calls and it started to get some good results I was about to wrap up a first working version and when I presented it to my bro on Discord this was the revelation The audits were pretty fast and we started to create an organization links at the end of the article as well as an RFC and some implementations for Node and PHP Usage exampleI stick to PHP since my end goal is to have a tool to quickly audit my Laravel public routes to be sure I have the best score possible to optimize my ranking another Dev to article on the project I am baking is coming Lightship PHP is supporting PHP and greater The installation and usage is dead simple Install the packageFirst start by requiring the package into your project composer require lightship core lightship php Create the scriptCreate a PHP file and insert this code use Lightship Lightship require DIR vendor autoload php lightship new Lightship lightship gt route gt route gt route gt analyse file put contents report json lightship gt toPrettyJson Execute the scriptNow just run this command on your terminal and after a few seconds a new file report json will appear with the scores and results for each of your URLs php index phpThe report json looks like this url https example com durationInSeconds scores seo security performance accessibility seo name titlePresent passes true name langPresent passes false security name xFrameOptionsPresent passes false name strictTransportSecurityHeaderPresent passes false performance name textCompressionEnabled passes true name noRedirects passes true accessibility name metaViewportPresent passes true name useLandmarkTags passes false What s next I would like to keep going and give more for you guys I will create in the next days a Laravel package to be able to automatize this for you with a nice console report You should also take a look at the PHP repository for Lightship PHP you will learn How to run a script and display a console report yourselfHow to use a lightship json configuration file with many more features like query string and base domain support You also will play an essential role because this package can t live without your support and feedbacks Please let me know here in the comments what do you think what can I improve or all your suggestions to make it more viable for a v If you want to play with it and create your own implementation please go ahead and I will reference it on the RFC README I think this can be a very good way to train your programming skills I had so much fun doing the PHP implementation PHP repository RFC repository Happy web audit |
2022-04-24 20:40:04 |
海外TECH |
DEV Community |
Chopping the monolith |
https://dev.to/apisix/chopping-the-monolith-4f1g
|
Chopping the monolithIf you attend conferences or read technical articles you could think that microservices are the correct and only way to build a system at the moment Despite some pushback from cooler heads the default architecture is microservices In this post I d like to argue why it s wrong I ll first get back to the origin of microservices and the fundamental reason to use them Then I ll describe why microservices don t fit most organizations structures Afterward I ll move to detail the root problem to solve I ll conclude by proposing an alternative less risky approach You re not doing microservicesMicroservices seem ubiquitous A conference must have microservices in its name or doesn t attract that many attendees Some conferences are entirely dedicated to microservices On the developer side Hype Driven Development has hit full force Everybody needs to put Microservices on their résuméto be considered for their next position I regularly point out that our industry is crazy most of the trends are driven by hype rather than reason Before going further we need to define what are microservices I ll limit myself to quoting Martin s Fowler bliki as it captures their essence In short the microservice architectural style is an approach to developing a single application as a suite of small services each running in its own process and communicating with lightweight mechanisms often an HTTP resource API These services are built around business capabilities and independently deployable by fully automated deployment machinery There is a bare minimum of centralized management of these services which may be written in different programming languages and use different data storage technologies Microservices a definition of this new architectural termThe article goes on to describe the characteristics of microservices Componentization via ServicesOrganized around Business CapabilitiesSmart endpoints and dumb pipesDecentralized GovernanceDecentralized Data ManagementInfrastructure AutomationDesign for failureEvolutionary DesignProducts not ProjectsIn general it goes all well until we reach the last point A project and a product are quite different a project has a planned end date while one develops a product until it s decommissioned Reality check most organizations plan projects Hence they cannot claim to do microservices unless they want to prove that Fowler is wrong Before microservices became a hype writers and speakers were careful to explain Conway s Law Any organization that designs a system defined broadly will produce a design whose structure is a copy of the organization s communication structure Melvin E Conway Unrelated but fun I took a selfie with M Conway Ergo if you want to design a microservices architecture you need to design your organization around small teams Amazon Web Services indeed documents this approach We try to create teams that are no larger than can be fed by two pizzas said Bezos We call that the two pizza team rule Two Pizza TeamsThe main idea behind the two pizza team is that it should be as independent as possible to benefit from the highest velocity possible Teams are characterized by being self organizing and autonomous Given Conway s Law when an organization consists of two pizzas teams it will eventually converge toward a microservice architecture It begets the naïve question are organizations that implement microservices organized around small autonomous teams Unfortunately traditional organizations are still built around silos The only way to succeed with a microservice architecture is to arrange the organization around them It s a huge organizational change It requires time and goodwill and specialized help from change management experts What happens in reality however is entirely different A technical lead or architect reads about microservices They remember mostly the benefits part and forget the requirements and downsides part In addition because of their position they see everything through technical tainted lenses Because of Conway s Law any such microservices effort is doomed to fail The result will be an information system that doesn t benefit from most benefits of microservices if any while having to bear all of their downsides Delivery timeIn one of his other posts Fowler mentions the pros and cons of microservices Benefits Costs Strong Module Boundaries Independent Deployment Technology Diversity Distribution Eventual Consistency Operational ComplexityI think the main reason to adopt a microservice architecture is independent deployment Many other ways are available to enforce strong module boundaries with fewer issuesTechnology diversity may satisfy the technical aspirations of some members of an organization However it does impair the organization as a whole making hiring training and reducing the bus factor harder Now the question is why is independent deployment desirable Business doesn t care about deployment in itself the IT department is just a huge black box In IT two metrics are important Implementation time the time it takes for development to implement a specified featureDeployment time the time it takes for integration to deploy the ready implementation in the production environmentBut it s IT internal The business cares only about how long it takes for its specification to be in production not how it s broken down Let s call delivery time the addition of implementation and deployment time Lowering delivery time is not a new issue and has found other solutions in the past Note that delivery time is different from lead time one of the DevOps golden metrics Lead time includes spec time the delay between the basic idea and the finalized specifications My experience is that spec time involves a lot of back and forth between the business and IT Of course it depends a lot on the maturity of the organization Still delivery time makes more sense in the scope of this post Rules enginesBefore people theorized Agile and Continuous Deployment concepts organizations did deploy a couple of times a year We named them release trains And indeed they were very akin to trains if your feature was too late you had to wait until the next release train Depending on the frequency it could mean a couple of months up to six The business didn t want to miss the train Between release trains the only accepted changes were bug fixes It was a time honoured tradition to squeeze one or two additional minor features with a bugfix so as not to wait for the next train Sometimes it worked most of the time the release manager a k a the watchdog didn t allow it Sometimes it was a power play between the business which wanted a deployment as soon as possible and operations which saw it as a risk The tension between business and IT found original solutions appeared Among them were rules engines A business rules engine is a software system that executes one or more business rules in a runtime production environment The rules might come from legal regulation An employee can be fired for any reason or no reason but not for an illegal reason company policy All customers that spend more than at one time will receive a discount or other sources A business rule system enables these company policies and other operational decisions to be defined tested executed and maintained separately from application code Business rules engine Emphasis mine As an example imagine a tax computing application Taxes may change at arbitrary dates Tax computation logic is moved to the Rules Engine to avoid putting unnecessary pressure on the IT department UI and routing code as well as tax unrelated business logic all stay in the application The main idea is that the business must be able to configure the rules in production by themselves no IT intervention is needed Business experts can change the rules independently of the release cadence Of course with great powers come great responsibility Business is independent but bears the consequences of misconfiguration Code parts change at different speedWe moved tax computation logic to the Rules Engine in the tax application above Application designers inferred beforehand that this logic would be the most subject to change Indeed any change in the law could impact tax computation and require changes in the code It s better to decouple the tax computation s lifecycle from the regular application because they change at different speeds Worse the former changes at an arbitrary speed the law which is not under the business control The tax example is a trivial one Yet across the continuum of applications the fact is that some parts change more often than others As a result proponents of the microservice approach split the app into parts so they can change independently I ve shown in the first section that it doesn t work without the right kind of organization Additionally this approach has two design assumptions We can somehow divine the boundaries of the parts during the design phaseAll parts need to change at an arbitrary speed Both are dead wrong The current consensus regarding microservices seems to start from a monolith Only then after some time one can refine the inferred boundaries it s time to split to microservices What if instead of splitting to microservices one would chop the part that changes the most frequently or the most arbitrarily We could keep the monolith minus this part Different implementation options for this part are available Rules Engines if you have experience and are happy with themServerless functions Regular microservicesSomething else How to chop Once you ve analyzed the boundaries and isolated the part to chop the next problem is how to achieve it In one of his famous articles Martin Fowler him again describes the Strangler pattern An alternative route is to gradually create a new system around the edges of the old letting it grow slowly over several years until the old system is strangled Doing this sounds hard but increasingly I think it s one of those things that isn t tried enough In particular I ve noticed a couple of basic strategies that work well The fundamental strategy is EventInterception which can be used to gradually move functionality to the strangler fig and to enable AssetCapture StranglerFigApplicationOne can use the pattern to migrate to a microservices architecture Indeed Chris Richardson includes it in its portfolio of microservices patterns However nothing prevents you from Migrating the part to something else e g a Serverless functionStopping at any point in the processThe biggest issue is regarding clients Migrating an HTTP endpoint to a different location will break them However with the help of a front end API Gateway it s a no brainer Just route the request to the new endpoint location and you re done ConclusionIn this post I highlighted that microservices as presented in conferences are doomed to fail in most organizations Still the current environment requires frequent updates to some parts of the code Because it s hard to know all parts before the first deployment it makes sense to start with a simple monolith With time we can analyze which parts are the most frequently updated At this point we can chop these parts into a separate deployment unit Its nature a micro service a serverless function etc doesn t change the overall architecture To keep clients from breaking we should update the routes in the API Gateway from the old endpoint to the new one I will go through this process with a code base and explain each step in the next post To go further Microservices a definition of this new architectural termConway s LawThe Strangler Fig ApplicationOriginally published at A Java Geek on April th |
2022-04-24 20:21:01 |
海外TECH |
DEV Community |
Javascript 1O1 series: Array’s Methods And Iterators Part(1), Methods. |
https://dev.to/osam1010/javascript-1o1-series-arrays-methods-and-iterators-part1-methods-24ff
|
Javascript O series Array s Methods And Iterators Part Methods You ll learn Some useful array methods to make dealing with arrays is an easy thing I hope you won t find any issues with handling arrays operations from now on Insert and Remove shift shift is used to remove the first element of the array Array shift unshift unshift is used to insert an element into the array unshift will add the element to the start of the arraypush push is used to append elements to the array add to the end pop pop is used to pop out remove the last element of the array Sub arrays slice slice is used to copy elements in a specific range e g you have an array and you want to get the elements between index and index when the end parameter is not defined then the slice extends to the end of the arraylet slicedArr arr slice spliced slice is used to REMOVE elements from an array Reordering reverse used to reverse the array s elements sort By default the sort function sorts values as strings This works well for strings Apple comes before Banana However if numbers are sorted as strings is bigger than because is bigger than Because of this the sort method will produce incorrect result when sorting numbers You can fix this by providing a compare function so without compare function sort is not that useful more about sort Array prototype sort JavaScript MDN The sort method sorts the elements of an array in place and returns the sorted array The default sort order is ascending built upon converting the elements into strings then comparing their sequences of UTF code units values developer mozilla org Search and Sort includes used to check if an element does exist or not at simple you pass an index and you get the value in that index indexOf indexOf is the opposite of at you pass a value and get the value s index in the array sort sort can be used here as wellBy default the sort function sorts values as strings This works well for strings Apple comes before Banana However if numbers are sorted as strings is bigger than because is bigger than Because of this the sort method will produce incorrect result when sorting numbers You can fix this by providing a compare function so without compare function sort is not that useful more about sort Array prototype sort JavaScript MDN The sort method sorts the elements of an array in place and returns the sorted array The default sort order is ascending built upon converting the elements into strings then comparing their sequences of UTF code units values developer mozilla org Adding and combining arrays concat used to combine add together two or more arrays non of the combined arrays will be modified concat will return a new array instead Array to String conversion toString used to represent an array in string format there is also toLocalString search about it as an exercise and learn the difference between toString and toLocalString if you know please share the answer in a comment Other methods flat when you have a nested arrays and want to pull out all these nested arrays to a new array flat is used flat doesn t modify the array it returns a new array instead fill used to fill the whole or part of the array with a specific value References javascript plainenglish io JavaScript The Definitive Guide th Edition Book JavaScript is the programming language of the web and is used by more software developers today than any other programming language For nearly years this best seller has been … Selection from JavaScript The Definitive Guide th Edition Book oreilly com javascript info Array JavaScript MDN The Array object as with arrays in other programming languages enables storing a collection of multiple items under a single variable name and has members for performing common array operations developer mozilla org JavaScript Basic Array Methods GeeksforGeeks A Computer Science portal for geeks It contains well written well thought and well explained computer science and programming articles quizzes and practice competitive programming company interview Questions geeksforgeeks org Must Know JavaScript Array Methods Master JavaScript arrays with these methods and become a more productive JavaScript developer livecodestream dev Thanks for reading and feel free to ask any question about javascript or this series and I appreciate any feedback to improve My content Find me on twitter github and my portfolio |
2022-04-24 20:19:25 |
ニュース |
BBC News - Home |
Emma Raducanu wins Breakthrough of the Year at 2022 Laureus Sports Awards |
https://www.bbc.co.uk/sport/61211260?at_medium=RSS&at_campaign=KARANGA
|
Emma Raducanu wins Breakthrough of the Year at Laureus Sports AwardsTennis player Emma Raducanu wins the Breakthrough of the Year award at the Laureus World Sports Awards one of three British winners |
2022-04-24 20:14:46 |
ニュース |
BBC News - Home |
Macron: I am everyone's president |
https://www.bbc.co.uk/news/world-europe-61211790?at_medium=RSS&at_campaign=KARANGA
|
emmanuel |
2022-04-24 20:24:35 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
那須川天心vs武尊戦、フジテレビで生中継があるのにアベマが有料ネット配信する理由 - リモート沸騰 エンタメ・冠婚葬祭・ビジネス |
https://diamond.jp/articles/-/302102
|
abema |
2022-04-25 05:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
初心者がExcelと仲良くなる方法、便利機能やクセを知って「手抜き上手」に! - Excelエリートへの道 |
https://diamond.jp/articles/-/301517
|
excel |
2022-04-25 05:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
起業で「泥沼にはまる人」と成功する人の決定的な差、ジリ貧を防ぐには - 転職で幸せになる人、不幸になる人 丸山貴宏 |
https://diamond.jp/articles/-/302194
|
沼にはまる |
2022-04-25 05:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
渋谷教育学園幕張の合格者が一番多い塾はどこ?主要10塾・過去16年の実績で比較 - DIAMONDランキング&データ |
https://diamond.jp/articles/-/301601
|
|
2022-04-25 05:12:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
パナソニック楠見新体制は“津賀人材”を温存、「次世代の中核候補2人」とは - 人事コンフィデンシャル |
https://diamond.jp/articles/-/301121
|
津賀一宏 |
2022-04-25 05:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「ソニーは松下電器に全てで劣っている」と、ソニー元CEOが結論づけたワケ - 元ソニーCEO・出井伸之「人生の経営」 |
https://diamond.jp/articles/-/302029
|
|
2022-04-25 05:05:00 |
北海道 |
北海道新聞 |
江差追分全国大会の地区選抜3年ぶり開催 全国大会開催を前提に |
https://www.hokkaido-np.co.jp/article/673507/
|
全国大会 |
2022-04-25 05:34:28 |
北海道 |
北海道新聞 |
巡視船が子ども1人を救助 知床の観光船事故 |
https://www.hokkaido-np.co.jp/article/673605/
|
知床半島 |
2022-04-25 05:31:25 |
北海道 |
北海道新聞 |
イラン核問題で懸念共有 米イスラエル首脳が電話 |
https://www.hokkaido-np.co.jp/article/673603/
|
米大統領 |
2022-04-25 05:10:00 |
ビジネス |
東洋経済オンライン |
本読みの達人が推薦!いま読むべきビジネス書10 分厚いビジネス書を読むことで思考力を鍛える | 最新の週刊東洋経済 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/583830?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
東洋経済オンライン |
2022-04-25 05:40:00 |
ビジネス |
東洋経済オンライン |
「最近疲れやすい」に隠れている貧血という病 大量の「氷」を急に食べるようになったら要注意 | 医師が伝える「生きやすさのコツ」 | 東洋経済オンライン |
https://toyokeizai.net/articles/-/582743?utm_source=rss&utm_medium=http&utm_campaign=link_back
|
東洋経済オンライン |
2022-04-25 05:20:00 |
コメント
コメントを投稿