投稿時間:2022-04-03 07:16:23 RSSフィード2022-04-03 07:00 分まとめ(20件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
Google カグア!Google Analytics 活用塾:事例や使い方 「stand.fmの歴史」を朗読していただきました https://www.kagua.biz/marke/podcast/20220403a1.html 「standfmの歴史」を朗読していただきました年月に発売しましたオーディオブック「standfmの歴史」ですが、おかげさまで朗読配信をしていただけています。 2022-04-02 21:00:20
python Pythonタグが付けられた新着投稿 - Qiita Kaggleの臨床検査データセットを使ってみた① ~モデルの性能比較をしてみた~ https://qiita.com/tuk19/items/b0df794d4d827511adf1 Kaggleの臨床検査データセットを使ってみた①モデルの性能比較をしてみた概要Kaggleの血液検査データセットを使ってデータ分析をしてみた。 2022-04-03 06:39:03
海外TECH MakeUseOf Mac Keyboard Not Working? Tips and Tricks on How to Fix It https://www.makeuseof.com/tag/trouble-apple-keyboard-heres-fix/ apple 2022-04-02 21:45:13
海外TECH MakeUseOf How to Write an ISO Image File to USB Flash With Etcher https://www.makeuseof.com/how-to-write-an-iso-image-file-to-usb-flash-with-etcher/ media 2022-04-02 21:30:14
海外TECH DEV Community Media Queries Level 5: the ability to respond to user needs https://dev.to/angellicaaraujo/media-queries-level-5-the-ability-to-respond-to-user-needs-2p68 Media Queries Level the ability to respond to user needsRecently web dev Blog published a web article by Una Kravets presenting an in depth view of the component driven world aims in a new responsive era In what follows I will try to summarise it from my perspective understanding how it is becoming easier to cover the end user preferences all of it with the new responsive approach So Web Components meaning relies on custom reusable and encapsulated HTML tags They can be used with any library or framework that works with HTML across modern browsers since they are built on solid standards Someone once told me that when something takes an hour or more to be explained it certainly cannot be sold easily Well it is becoming easier to find short good quality material about Web Components when searching for it Take as example a video that length is half hour explaining some specific concept in a hard scenario It is important to you to know that those standards and APIs are made of big effort of engineers responsible for prototyping speccing and starting the implementation for the next era of responsive design So a good tutorial that may takes you half hour to get completed certainly pays off On going changes and updates includes user preference based media features container queries and media queries for new screen types such as foldable screens Let s have a little of each topic and the main concepts involved while we understand how important it can be The ability to respond to user needsIf you re not familiar with the concept of accessibility and user preferences then I recommend that you read the Stories of Web Users em Accessibility Fundamentals da W as a more reliable way of introduction content Well when we talk about accessibility we are talking about a set of preferences inherent by a group of users that need to be addressed So if they meet adherence to their needs then the content or service provided can successfully meet this audience To get a little more familiar with who these users are and their needs you can gather information at the CDC I ve chosen the following topic attention deficit hyperactivity disorder ADHD which represents one of User Stories by W You can try doing the same with other topics So according to the CDC at least a total of million children aged years were diagnosed with ADHD in the US in In addition to ADHD according to the CDC the diagnosis of ADHD can be followed by other disorders such as anxiety about in children with ADHD had anxiety Now we can start talking about Preety s User Story as an example which is somewhat well aligned with the CDC data on ADHD Preety is a young person diagnosed with ADHD Preety s experience varies greatly depending on how well the content or service adheres to accessibility Preety s experience with websites varies greatly from one site to another Some sites use graphics and illustrations in a way that helps her to focus on the sections and content that she would like to read while other sites have a lot of advertisements and moving content that is very distracting User Stories Preety WAI by W If Preety was years old in being a subject of the CDC research group and positively diagnosed she would be an adult today During her school life technologies were introduced and she somehow managed to overcome the difficulties with the help of appropriate tools However some of these preferences are set at the operating system level and are far from capture capability for some web APIs In fact some others preferences had the usage extended to users who do not see themselves in any of the User Stories at all Do you need more examples Preferences for light dark or auto themes Whether to ensure that Preety s future could share of the same excellence as possible as her colleagues does to save a device s battery or simply adapt the system just for the visual preferences User Preferences are extremely relevant and are increasingly included in the new responsive era evolution loop Media FeaturesIt is common that a developer frontend engineers in a special case faces different behaviors implementation requests for elements given an interface depending on the user agent display device or even the document being rendered This is usually done through Media Queries Developers make usage of Media Queries as a method to access information about aspects related to the user agent that the document is being displayed The method follows an interpretation path as shown in Figure The syntax allows us to build modifiers according to the media type and other features once the media condition is met then the user will be able to experience features developed exclusively for the scenario User preference based media featuresWell now we can start talking about the advances regarding the adoption of certain user preferences that in many ways are available at the operational system level Consider an option for macOs Stop or reduce the movement of some elements on the screenーfor example when you open apps switch between desktops or open and close Notification Center This feature is especially useful for people who experience motion sickness or vertigo Reduce screen motion on Mac by macOS User GuideThe example above is a reference to the prefers reduced motion option covered in the Media Queries Level specification The latest specification introduces so called user preference media features that is a way for sites to detect the user s preferred way to display content Therefore considering the prefers reduced motion preference in page design creates an inclusive environment for people like Preety allowing your application to be instrumentalized at the level of preferences that come directly from the operational system Additionally in their operating system whether it s on desktop or mobile users can set a preference for light dark or auto themes According to the new specification you can use prefers color scheme to customize your UI to itSee specification for more options Detecting the desire for less motion on the page the prefers reduced motion featureDetecting the desire for reduced transparency on the page the prefers reduced transparency featureDetecting the desire for increased or decreased color contrast from elements on the page the prefers contrast featureDetecting Forced Colors Mode the forced colors featureDetecting the desire for light or dark color schemes the prefers color scheme featureDetecting the desire for reduced data usage when loading a page the prefers reduced data feature Media Queries Level WC ConclusionThink of it as a further move into the new responsive era The Component driven approach from the developer s point of view is becoming the better way you project build and deploy a scalable Web application regarding new accessibility preferences Additional reading and tutorialsBuilding Components Web Fundamentals by developers googleweb dev prefers color scheme Hello darkness my old friend by Thomas SteinerWhat is Media Query CSSWG Draft WC Click here to learn moreA Complete Guide to CSS Media Queries CSS Tricks References web dev Blog published a web article by Una Kravets Accessibility Fundamentals Stories of Web Users by W Attention Deficit Hyperactivity Disorder ADHD Data and Statistics About ADHD by CDC Media Queries Level CSSWG WC Editor s Draft February Figure Taken from CSSWG W Website Click here for more Reduce screen motion on Mac Apple Support prefers reduced motion mdn web docs Mozilla web dev prefers color scheme Hello darkness my old friend by Thomas SteinerCover image was taken from Cavaon User Experience UX The Importance of Understanding Users Needs 2022-04-02 21:32:20
海外TECH DEV Community Flutter App IOS Build 💫 🌌 ✨ https://dev.to/gulsenkeskin/flutter-app-ios-build-48lc Flutter App IOS Build IOS Build Uygulamanızıoluşturmak ve yayınlamak için Xcode gereklidir Bu kılavuzu takip etmek için macOS çalıştıran bir cihaz kullanmalısınız Adımlar BundleId oluşturma Geliştirici hesabından UygulamayıApp Store Connect de kaydetmek Xcode ya da Codemagic CLI ıkullanarak build arşivi oluşturma UygulamayıApp Store da yayınlama UygulamanızıApp Store Connect e kaydedin Uygulamanızın yaşam döngüsünüApp Store Connect te eski adıyla iTunes Connect yönetin App Store ve TestFlight ta uygulama adınızıve açıklamanızıtanımlar ekran görüntüleri ekler fiyatlandırmayıayarlar ve sürümleri yönetirsiniz Uygulama kaydetmek iki adımdan oluşur Benzersiz unique bir Bundle ID kaydetme App Store Connect te bir uygulama kaydıoluşturma Bir Bundle ID Kaydedin Her iOS uygulaması Apple a kayıtlıbenzersiz bir tanımlayıcıolan Bundle ID ile ilişkilendirilir •Geliştirici hesabınızın App IDs sayfasınıaçın •Yeni bir Bundle ID oluşturmak için öğesine tıklayın •Bir uygulama adıgirin Explicit App ID yi seçin ve bir ID girin •Uygulamanızın kullandığıhizmetleri seçin ve ardından Continue a tıklayın •Sonraki sayfada ayrıntılarıonaylayın ve Bundle ID nizi kaydetmek için Register a tıklayın Bir UygulamayıApp Store Connect e kaydetmek için •Tarayıcınızda App Store Connect i açın •App Store Connect açılışsayfasında My Apps e tıklayın •My Apps sayfasının sol üst köşesindeki butonuna tıklayın ardından New App i seçin •Açılan forma uygulamanızın ayrıntılarınıgirin Platforms bölümünde iOS un işaretli olduğundan emin olun Flutter şu anda tvOS u desteklemediğinden bu onay kutusunu işaretlemeden bırakın Create e tıklayın •Uygulamanızın application details alanına gidin ve sidebar dan App Information nıseçin •General Information bölümünde önceki adımda kaydettiğiniz Bundle ID yi seçin Xcode proje ayarlarınızıgözden geçirin Bu adım Xcode çalışma alanındaki workspace en önemli ayarların gözden geçirilmesini kapsar •Xcode da target s settings e gidin •Xcode da uygulamanızın ios klasöründe Runner xcworkspace i açın •Uygulama ayarlarınızıgörüntülemek için Xcode proje gezgininde Runner projesini seçin Ardından sidebar da Runner alanınıseçin General sekmesini seçin En önemli ayarlarıdoğrulayın Identity bölümünde Display Name Uygulamanızın görünen adı Bundle Identifier App Store Connect te kaydettiğiniz App ID Signing amp Capabilities bölümünde Automatically manage signing Xcode un uygulama imzalama ve sağlamayıotomatik olarak yönetmesi gerekip gerekmediği Bu varsayılan olarak true dur ve çoğu uygulama için yeterli olacaktır Team KayıtlıApple Developer hesabınızla ilişkili ekibi seçin Gerekirse Add Account öğesini seçin ardından bu ayarıgüncelleyin Build Settings bölümünde iOS Deployment Target Uygulamanızın desteklediği minimum iOS sürümü Flutter iOS ve sonraki sürümleri destekler Uygulamanız veya eklentileriniz iOS dan daha yeni API leri kullanan Objective C veya Swift kodu içeriyorsa bu ayarıgereken en yüksek sürüme güncelleyin Uygulama dağıtım sürümünügüncelleme Xcode projenizde Deployment Target alanınıdeğiştirdiyseniz Flutter uygulamanızda ios Flutter AppframeworkInfo plist i açın ve MinimumOSVersion değerini eşleşecek şekilde güncelleyin Uygulama sürüm numarasınıgüncelleme Uygulamanın varsayılan sürüm numarası dır Güncellemek için pubspec yaml dosyasına gidin ve aşağıdaki satırıgüncelleyin version Sürüm numarası yukarıdaki örnekte gibi noktalarla ayrılmışüçsayıdır ve ardından yukarıdaki örnekte gibi isteğe bağlıbir build number gelir ve ile ayrılır Flutter ın derlemesinde hem version hem de build number sırasıyla build name ve build number belirtilerek geçersiz kılınabilir iOS ta build name CFBundleShortVersionString i build number CFBundleVersion ıkullanır Bir app icon ekleyin Xcode project navigator da Runner klasöründe Assets xcassets öğesini seçin Placeholder iconlarınıkendi uygulama simgelerinizle güncelleyin Uygulamanızıflutter run kullanarak çalıştırın ve simgenin değiştirildiğini doğrulayın Xcode ile bir build arşivi oluşturunUygulamanızıApp Store veya TestFlight taki kullanıcılara göndermeye hazır olduğunuzda bir release build sürüm derlemesi hazırlamanız gerekir Xcode da uygulama sürümünüyapılandırın ve şunu oluşturun Xcode da uygulamanızın ios klasöründe Runner xcworkspace i açın Xcode proje gezgininde Runner ıseçin ardından ayarlar görünümükenar çubuğunda Runner hedefini seçin Identity bölümünde Version u yayınlamak istediğiniz kullanıcıya yönelik version numarasına güncelleyin Identity bölümünde Build identifier ıApp Store Connect te bu build i izlemek için kullanılan unique bir build number la güncelleyin Her yükleme benzersiz bir build number gerektirir Son olarak bir build archive oluşturun ve bunu App Store Connect e yükleyin Bir build archive oluşturmak için flutter build ipa yıçalıştırın Xcode da build ios archive MyApp xcarchive dosyasınıaçın Validate App button una tıklayın Herhangi bir sorun bildirilirse bunlarıele alın ve başka bir build oluşturun Bir arşiv yükleyene kadar aynıbuild ID i yeniden kullanabilirsiniz Arşiv başarıyla doğrulandıktan sonra Distribute App e tıklayın Derlemenizin durumunu uygulamanızın App Store Connect teki app s details sayfasının Activities sekmesinden takip edebilirsiniz Not UygulamanızıDistribute App in sonunda dışa aktardığınızda Xcode uygulamanızın IPA sınıve bir ExportOptions plist dosyasınıiçeren bir dizin oluşturur Flutter build ipa export options plist path to ExportOptions plist i çalıştırarak Xcode u başlatmadan aynıseçeneklerle yeni IPA lar oluşturabilirsiniz dakika içinde build inizin doğrulandığınıve TestFlight ta test kullanıcılarına sunulmaya hazır olduğunu bildiren bir e posta alacaksınız Bu noktada TestFlight ta yayınlamayıveya devam edip uygulamanızıApp Store da yayınlamayıseçebilirsiniz Codemagic CLI araçlarıyla build arşiv oluşturmak için Bu adım bir build arşiv oluşturmayıve Flutter proje dizinindeki bir terminalde yürütülen Flutter derleme komutlarınıve Codemagic CLI Araçlarınıkullanarak derlemenizi App Store Connect e yüklemeyi kapsar Bu login keychain den izole edilmişgeçici bir keychain le dağıtım sertifikalarının distribution certificates tam denetimine sahip bir build arşivi oluşturmanıza olanak tanır Codemagic CLI araçlarınıkurun pip install codemagic cli toolsApp Store Connect ile işlemleri otomatikleştirmek için App Manager erişimi olan bir App Store Connect API Key oluşturmanız gerekir Sonraki komutlarıdaha kısa hale getirmek için new key den şu ortam değişkenlerini ayarlayın issuer id key id and API key file export APP STORE CONNECT ISSUER ID aaaaaaaa bbbb cccc dddd eeeeeeeeeeeeexport APP STORE CONNECT KEY IDENTIFIER ABCexport APP STORE CONNECT PRIVATE KEY cat path to api key AuthKey XXXYYYZZZ p Bir build arşivini kodlamak ve paketlemek için bir iOS Distribution sertifikasınıexport etmeniz veya oluşturmanız gerekir Mevcut sertifikalarınız varsa her sertifika için aşağıdaki komutu yürüterek private key i export edebilirsiniz openssl pkcs in lt certificate name gt p nodes nocerts openssl rsa out cert keyVeya aşağıdaki komutu uygulayarak yeni bir private key oluşturabilirsiniz ssh keygen t rsa b m PEM f cert key q N Daha sonra CLI araçlarının private keyden otomatik olarak yeni bir iOS Dağıtımıoluşturmasınısağlayabilirsiniz Kod imzalama için kullanılacak yeni bir geçici keychain ayarlayın keychain initializedaha sonra bunu çalıştırın keychain use loginBu makinenizdeki uygulamalarla ilgili olasıkimlik doğrulama sorunlarınıönlemek için login keychain inizi oturum açma anahtar zincirinizi varsayılan olarak ayarlar App Store Connect ten kod imzalama dosyalarınıalın app store connect fetch signing files xcode project detect bundle id platform IOS type IOS APP STORE certificate key file path to cert key createBurada cert key export edilen iOS Distribution certificate private key veya otomatik olarak yeni bir sertifika oluşturan yeni bir private keydir Sertifika App Store Connect te yoksa özel anahtardan oluşturulacaktır Alınan sertifikalarıkeychain ize ekleyin keychain add certificatesGetirilen kod imzalama profillerini kullanmak için Xcode proje ayarlarınıgüncelleyin xcode project use profilesFlutter bağımlılıklarınıyükleyin flutter packages pub get CocoaPods bağımlılıklarınıyükleyin find name Podfile execdir pod install Flutter ıiOS projesini oluşturun flutter build ipa release export options plist HOME export options plistexport options plist öğesinin xcode project use profiles komutunun çıktısıolduğunu unutmayın UygulamayıApp Store Connect te yayınlayın app store connect publish path find pwd name ipa Daha önce de belirtildiği gibi makinenizdeki uygulamalarla ilgili kimlik doğrulama sorunlarınıönlemek için login keychain inizi oturum açma anahtar zincirinizi default olarak ayarlamayıunutmayın keychain use login dakika içinde yapınızın doğrulandığınıve TestFlight ta test kullanıcılarına sunulmaya hazır olduğunu bildiren bir e posta alacaksınız Bu noktada TestFlight ta yayınlamayıveya devam edip uygulamanızıApp Store da yayınlamayıseçebilirsiniz UygulamanızıTestFlight ta yayınlayın TestFlight geliştiricilerin uygulamalarınıdahili ve harici test cihazlarına aktarmalarına olanak tanır Bu isteğe bağlıadım derlemenizi TestFlight ta yayınlamayıkapsar App Store Connect te uygulamanızın application details sayfasının TestFlight sekmesine gidin Sidebar dan Internal Testing i seçin Test kullanıcılarına yayımlanacak derlemeyi buildi seçin ve ardından Save e tıklayın Herhangi bir dahili test kullanıcısının e posta adreslerini ekleyin Sayfanın üst kısmındaki açılır menüden erişilebilen App Store Connect in Users and Roles sayfasında ek dahili kullanıcılar ekleyebilirsiniz UygulamanızıApp Store da yayınlayın App Store Connect te uygulamanızın application details sayfasının sidebar ından Pricing and Availability i seçin ve gerekli bilgileri tamamlayın Sidebar dan status üseçin Bu bu uygulamanın ilk sürümüyse status Prepare for Submission Gönderime Hazırla dır Tüm gerekli alanlarıdoldurun Submit for Review e tıklayın Apple uygulama inceleme süreci tamamlandığında sizi bilgilendirir Uygulamanız Version Release bölümünde belirttiğiniz talimatlara göre yayınlanır resource 2022-04-02 21:32:14
海外TECH DEV Community Documenting Code in C# https://dev.to/pixelatedlagg/documenting-code-in-c-3f6c Documenting Code in C Oh boy it s that time again Ever get that feeling of dread when you write a new feature realizing that you need to document the code for it We ve all been there But hopefully this guide can help alleviate the pain of trying to standardize documentation across your codebase First we need to establish how C Intellisense handles suggestion comments The format is akin to XML in commented out code There are many special tags to help document your method class field but only a few really matter The most important tag in my opinion is the lt summary gt tag This tag allows you to make a summary of what your code does For an example let s make a simple method This method takes an integer as a parameter and returns the value doubled public int Double int i return i When I add the summary tag it looks like this lt summary gt Doubles an integer lt summary gt public int Double int i return i For the developer interacting with Double this is what is displayed The second most important tag is the lt value gt tag Now this tag only really applies to fields and is basically a summary for variables An example lt value gt The value of doubled lt value gt public int DoubledNumber Double What the developer sees The second to last tag I deem necessary is the lt returns gt tag The use of this tag is kind of in the name it informs about what the method returns Going back to Double here s an example lt summary gt Doubles an integer lt summary gt lt returns gt An integer lt returns gt public int Double int i return i What the developer sees Notice how the information is starting to pile up This is one of the reasons I prefer to only have a few tags per method we don t want to overwhelm the developer with trivial information The last tag we will discuss is the lt param gt tag This is used in a slightly different way than the other ones so pay attention Essentially the tag is used to give information about each individual parameter in a method An example lt summary gt Doubles an integer lt summary gt lt returns gt An integer lt returns gt lt param name i gt The integer to double lt param gt public int Double int i return i What the developer sees Even though I only used the lt param gt tag once you can stack it for as many paramaters as you want Now that we went over the basic tags you should have a general understanding of how the comment system works If you want to learn about more tags I find this Microsoft reference article works fine Thanks for reading 2022-04-02 21:30:20
海外TECH DEV Community Enabling keyboard navigation on your Mac https://dev.to/nickytonline/enabling-keyboard-navigation-on-your-mac-1hjb Enabling keyboard navigation on your MacI m starting a new role soon and they shipped me a brand new Macbook Pro I got everything set up on my Mac over the past few weeks but today I got a prompt about wanting to confirm the deletion of a file I used the keyboard like I did on my previous Mac and realized it didn t work I clearly had forgotten to adjust some settings on my new MacBook Sure I can use the mouse but I had been so used to the keyboard for this All right we need to head on over to our Keyboard settings See that checkbox labelled Use keyboard navigation to move focus between controls You re going to want to check that And you re done Now you can use the keyboard for things like confirmation dialogs Photo by hannah joshua on Unsplash 2022-04-02 21:29:36
海外TECH DEV Community Pensamento e verdade https://dev.to/maryrouse200/pensamento-e-verdade-4nc8 blogmaryrousecom 2022-04-02 21:13:21
海外TECH DEV Community Loading external configurations in Angular Universal https://dev.to/ayyash/loading-external-configurations-in-angular-universal-4di1 Loading external configurations in Angular UniversalIn my post Loading external configurations via http using APP INITIALIZER I attempted to load external configuration via HTTP on client side In this post I am explroing options for SSR Find the final result here StackBlitz External Remote ConfigurationExpanding on StackBlitz Token Test Project where the URL of the configuration had to be set to remote HTTP building locally and testing for server produced identical results The project resolve worked as expected The only issue was failure of remote URL meant blocking of app This is a pitfall of having a remote config One way to fix that is as follows Slight fix to configurationWe want to distinguish served configuration but we do not want to block the UI in case of failure The project resolve for example should decide what to do with error return this configService config pipe first n gt n isServed map n gt if served with error reroute or notify user but do not block user console log n withError let s introduce this property return true In ConfigService I will stop making a distinction between success and failure they both are served Then by introducing withError property will set it to true when failing after defining withError property in IConfig private createConfig config any withError boolean void cast all keys as are const config Config lt IConfig gt config is severd always config isServed true with error config withError withError set static member ConfigService config config next always next the subject this config next config loadAppConfig Observable lt boolean gt return this http get environment configUrl pipe map response gt create with no errors this createConfig response false return true catchError error gt if in error return set fall back from environment and create with errors this createConfig Config true return of false This works as expected however if the HTTP request fails on server Angular will attempt to reconnect after rehydration on client External Local ConfigurationMoving the files to localdata folder using angular json assets assets glob json input configs output localdata The config URL now looks like this localdata config json It is relative According to Angular Docs If you are using one of the nguniversal engine packages such as nguniversal express engine this is taken care for you automatically You don t need to do anything to make relative URLs work on the server Well I get GET localdata config prod json NetworkErrorI guess what they mean is that if you go their way of rending you are covered That is if you use this server get req res gt res render indexHtml req providers provide APP BASE HREF useValue req baseUrl But I don t And I will tell you why and how Then I will go through the solution for the relative URLs Isolating the serverIf we follow the documentation Server side rendering SSR with Angular Universal it walks you through building the sever in src folder and generating the sever in a build process I find that too obtrusive Coming from old school cannot sleep well while my server is in my development source code If something on the server goes wrong I have to build and test Everytime Not cool One good scenario I might post about soon is serving multilingual Angular app using the same build Let s first reduce the size of the server ts suggested by Angular Docs to have only the ngExpressEngine export it and create a separate express app server ts export the ngExpressEngineexport const AppEngine ngExpressEngine bootstrap AppServerModule Building the ssr uses the following angular json settings angular json architect server builder angular devkit build angular server options choose the output path where the main js will end up outputPath host server main server ts tsConfig tsconfig server json configurations production don t delete because there will be other files deleteOutputPath false The main js generated will end up in outputPath let s create a server there and use the exported AppEngine host server jsconst express require express express appvar app express setup expressrequire server express app setup routesrequire server routes app other stuff is up to you listenvar port process env PORT app listen port function err console log started to listen to port port if err console log err return The express module is basic you can have a look at it on StackBlitz The routes js is where the cooking happens PS I cannot test on StackBlitz you may want to use dirname to get accurate pathsconst express require express ngExpressEngine from compiled main jsconst ssr require main setup the routesmodule exports function app set engine we called it AppEngine in server ts app engine html ssr AppEngine set view engine app set view engine html set views directory app set views client expose the configs path as localdata or whatever you choose to name it app use localdata express static localdata fallthrough false expose client folder app use express static client now THIS app get req res gt point to your index html res render client index html req pass request res pass response here we can provide things for ssr In res render I passed back response and request just in case I want to use them in Angular It s rare but it happens So that s the why and how Provide absolute URLs for local requestsA local request is like our localdata config prod json To fix it it must be prepended by the server URL Our final result in ConfigService should look like this loadAppConfig Observable lt boolean gt fix url first if its on server let url environment configUrl if serverUrlExsits url serverUrl url return this http get url pipe etc The URL on the server is constructed using the REQUEST injection token as documented on NPM packages change ConfigService for this line to work install types expressimport Request from express import REQUEST from nguniversal express engine tokens Injectable export class RequestService make it Optional to work on browser platform as well constructor Optional Inject REQUEST private request Request loadAppConfig Observable lt boolean gt fix url first if its on server let url environment configUrl if this request on ssr get a full url of current server url this request protocol this request get host url etc Since we already provided req in the res render call this is sufficient But it looks ugly We can create an HTTP interceptor for localdata to make use of any other localdata But first The curious case of reverse proxyWithout digressing beyond the scope of this post reverse proxy and load balancing on production servers usually proxy https into http and real host com into localhost The latter we fixed by using req get host which accesses the header And to fix the protocol we access another header value x forwarded proto Here is an azure website example I set up notice how the values in the header are different than plain ones because of cloud hosting setup request headers host aumet azurewebsites net disguised host aumet azurewebsites net x original url webinfo x forwarded for client ip address here x forwarded proto https on other servers this could be localhost hostname aumet azurewebsites net path webinfo don t read this value protocol http But before I add that to my Angular App back to being obsessive about separation of concerns this is not an Angular issue thus it shall not belong to the app I would rather set up the right URL and provide it Like this in host server routes js change the final get app get req res gt fix and provide actual url let proto req protocol if req headers amp amp req headers x forwarded proto use this instead proto req headers x forwarded proto toString also always use req get host const url proto req get host res render client index html req res here provide it providers provide serverUrl useValue url Back to our Angular App let s create a proper HTTP interceptor to intecept localdata calls Angular inteceptor Injectable export class LocalInterceptor implements HttpInterceptor constructor inject our serverURL Optional Inject serverUrl private serverUrl string intercept req HttpRequest lt any gt next HttpHandler Observable lt HttpEvent lt any gt gt if request does not have localdata ignore if req url indexOf localdata lt return next handle req let url req url if this serverUrl use the serverUrl if it exists url this serverUrl req url const adjustedReq req clone url url return next handle adjustedReq Provide the HttpInterceptor in AppModule app module tsproviders provide APP INITIALIZER useFactory configFactory multi true deps ConfigService provide http interceptor here provide HTTP INTERCEPTORS useClass LocalInterceptor multi true And clean up ConfigService from any reference to our server Building testing works And what is so nice about this is you can change the server config prod json without restarting the server nor worry about polluting other environments and servers Now I can sleep better Providing the config on serverNow that we have a separate server and the cofiguration file is not remote why not provide the config and inject it in the ConfigService host server routes js require the json file sitting in localdataconst localConfig require localdata config prod json setup the routesmodule exports function app res render client index html req res also provide the localConfig providers provide localConfig useValue localConfig though don t lose the serverUrl it s quite handy In ConfigService constructor private http HttpClient optional injector for localConfig Optional Inject localConfig private localConfig IConfig loadAppConfig Observable lt boolean gt if on server grab config without HTTP call if this localConfig this createConfig this localConfig true return of true return this http get environment configUrl pipe This is the fastest and least error prone method for the server to get configuration But it might be an overkill for some May the force be with you Thank you for reading this far of my very long post I must have made a mistake let me know what it was ResourcesAngular Express EngineAngular DocsX Forwarded ProtoStackBlitz 2022-04-02 21:04:23
海外TECH DEV Community Fast project hosting / surge.sh https://dev.to/vadimfilimonov/fast-project-hosting-surgesh-1gl7 Fast project hosting surge shHere s the link Here s the video This article should be over by now but let me add a few words of my own surge is a web service that lets you publish a frontend application with just two commands You ll find it useful if you need to publish your project to the web temporarily And now I will start to rewrite the documentation Installationnpm install global surge Launchsurge Preparing for DeploymentSo we have a projectGo to the terminal and start surgesurge Deploy After registration confirm the path to the project specify the desired domain and press enter The purpose of this article was not to teach anything but to show that such a service exists in principle and how easy it is to work with it If you are interested in it and want to learn more about it it has a pretty good documentation 2022-04-02 21:02:50
海外TECH DEV Community VSCode: como commitar partes de um arquivo https://dev.to/igoracmelo/vscode-como-commitar-partes-de-um-arquivo-2dae VSCode como commitar partes de um arquivo IntroduçãoEscolher exatamente o que vai commitar éútil em algumas situações como por exemplo Vocêestátrabalhando em duas coisas diferentes e quer separar essas coisas em commits separadosVocêtem certas alterações que ainda não estão prontas para serem commitadasSe vocênão tem muita experiência com linha de comando pode ficar tranquilo que vamos fazer tudo direto pelo VSCode Tutorial em vídeo Tutorial em textoNo VSCode clique em Source Control Váem Changes ou Alterações e clique no arquivo que vocêquer commitar Uma janela exibindo o antes e depois vai aparecer Na parte da direita selecione as linhas que vocêquer commitar e pressione botão direito Clique em Stage Selected Ranges ou então use o atalho ctrl K ctrl shift S Adicione tudo que quiser commitar dessa forma atéque sósobre em verde o que vocênão quer commitar Confira que as alterações estão corretasVáem Staged Changes Alterações Preparadas clique no arquivo e confira se tem sóas alterações que vocêquer commitar em seguida Faça o commitEscreva a mensagem e dêctrl Enter para commitar 2022-04-02 21:01:12
Apple AppleInsider - Frontpage News Senator concerned by hackers stealing user data using police email accounts https://appleinsider.com/articles/22/04/02/senator-concerned-by-hackers-stealing-user-data-using-police-email-accounts?utm_medium=rss Senator concerned by hackers stealing user data using police email accountsThe Senate is starting to take notice of reports hackers are forging emergency data requests to gain data from tech companies such as Apple with one starting to investigate the privacy issue On March a report surfaced revealing hackers were taking advantage of compromised government and police email accounts enabling them to pretend to be law enforcement officials By using the email accounts and connected services the hackers were able to demand data from tech companies in some instances Specifically the hackers abused emergency data requests EDRs demanding data on the claim there is the threat of imminent harm or death EDRs can provide law enforcement with data urgently without requiring a court order warrant or subpoena Read more 2022-04-02 21:38:20
Apple AppleInsider - Frontpage News Compared: Cricut Maker lineup vs Cricut Explore range https://appleinsider.com/articles/22/04/02/compared-cricut-maker-lineup-vs-cricut-explore-range?utm_medium=rss Compared Cricut Maker lineup vs Cricut Explore rangeWhether you re an avid crafter or starting your own small business and want to handle the merchandising yourself Cricut machines can help create some truly impressive projects Here s how each model compares to the next and which one you should check out Cricut MakerMaybe you ve known about Cricut for a while from the company s marketing to crafters Or perhaps you ve only recently seen them at your local Big Box Store and you re suddenly interested in what this machine can do Read more 2022-04-02 21:13:25
海外TECH Engadget Tesla's deliveries increased despite supply shortages and plant closures https://www.engadget.com/tesla-q-1-2022-deliveries-214141313.html?src=rss Tesla x s deliveries increased despite supply shortages and plant closuresTesla delivered vehicles over the first three months of the automaker announced on Saturday “This was an exceptionally difficult quarter due to supply chain interruptions and China Zero Covid policy Musk said on Twitter shortly after Tesla shared the news This was an exceptionally difficult quarter due to supply chain interruptions amp China zero Covid policy Outstanding work by Tesla team amp key suppliers saved the day ーElon Musk elonmusk April Last month saw the company suspend production at its Shanghai Gigafactory its largest manufacturing facility twice Despite those hiccups the vehicles Tesla delivered in Q represent a percent year on year increase from Q when the company shipped approximately cars According to Tesla the Model and Model Y made up the majority of its deliveries in Q with of those cars making their way to consumers since the start of the year Over the same time frame the company produced vehicles a not insignificant feat when you consider the supply chain issues that have affected Tesla and many other automakers nbsp nbsp Q also saw Tesla begin shipping vehicles from its billion Gigafactory in Grenheide Germany The company plans to eventually produce cars per year from the plant 2022-04-02 21:41:41
ニュース BBC News - Home Tory MP David Warburton suspended during investigation into claims https://www.bbc.co.uk/news/uk-60967143?at_medium=RSS&at_campaign=KARANGA david 2022-04-02 21:38:22
ニュース BBC News - Home War in Ukraine: Johnson congratulates Volodymyr Zelensky over Kyiv push back https://www.bbc.co.uk/news/uk-60970114?at_medium=RSS&at_campaign=KARANGA conference 2022-04-02 21:15:42
ニュース BBC News - Home Search under way in English Channel for missing small plane https://www.bbc.co.uk/news/uk-60970636?at_medium=RSS&at_campaign=KARANGA france 2022-04-02 21:55:27
ニュース BBC News - Home Savannah Marshall v Femke Hermans: Briton wins by KO to set up potential Claressa Shields fight https://www.bbc.co.uk/sport/boxing/60969304?at_medium=RSS&at_campaign=KARANGA Savannah Marshall v Femke Hermans Briton wins by KO to set up potential Claressa Shields fightWBO middleweight champion Savannah Marshall sensationally knocked out Femke Hermans in the third round to set up an undisputed match with long term rival Claressa Shields later this year 2022-04-02 21:48:31
ビジネス 東洋経済オンライン ウクライナ国民が直面する「コロナ感染の危機」 戦争最大の犠牲は戦死より「戦病死」という史実 | 新型コロナ、長期戦の混沌 | 東洋経済オンライン https://toyokeizai.net/articles/-/578623?utm_source=rss&utm_medium=http&utm_campaign=link_back 東洋経済オンライン 2022-04-03 06:30:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)