GENINE LABS 交易所

Software Development
With Firefox giving the HTML5 dialog element support since early 2022, we can now make use of this HTML 5.2 element to simplify our websites and make our life easier. It's usage is very simple, we can add the dialog tags to our page and put some content inside them. <dialog> <p>Testing dialogs</p> <button>Ok</button> </dialog> Opening and closing the dialog The dialog won't display itself by default unless you set the open attribute: <dialog open> <p>Testing dialogs</p> <button>Ok</button> </dialog> Alternatively, the HTMLDialogElement comes with 3 methods you can call using JavaScript: var dialog = document.getElementsByTagName("dialog")[0]; // Show() will display it same way as the "open" attribute does, allowing you to still interact // with the rest of HTML elements in the page not behind the dialog. dialog.show(); // This one…
Read More

BINSTARTER EXCHANGE

Software Development, Web programming
Introduced with C#9 (.Net 5) in November 2020, the new record type adds yet another way of declaring types in C#. By default record acts as reference type, like classes, but since C#10 you can also create a record struct (value type). You can also declare them using record class, but as that’s the default, you can omit the class type when doing so and declare them as just record. Record types are compiler-generated classes/structs with some predefined methods, they can be declared very lightly on coding but will then gain their features when compiled. They all follow the IEquatable interface. IEquatable : this interface ensures that they have value-based equality. This means that when comparing two of them, C# automatically compares their properties and the values inside them to…
Read More

GOMT LOGIN

Software Development
While you don't necessarily need to actually have a json config file when using lambdas, we like to have them to add some additional settings more easily than configuring that many env variables, and while releasing a new lambda I found it wasn't releasing the file alongside the lambda itself when using Amazon's Sam Client, though I think this can also happen when releasing using the AWS Wizard. To solve this issue, simply right click on the json file you want to be added to the compiled code and select Properties, then set the "Copy to output directory" property to "Always". Alternatively, just add this to the .csproj xml file: <ItemGroup> <None Update="appsettings.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup>
Read More

DEFENDER OF DOGE LOGIN

Software Development
Quick reminder: By default, a Step Function will take the output from previous task/lambda and give it to the next, so unless you want to specify how to handle the model in a particular way you don't need to use these properties. But if you need to, you've got: InputPath Will set what part of the current model should be given to the current Task. By default the entire model is given to the Task/Lambda. ResultPath In case you want to keep the model you had but still include the just finished tasks' result in it, you can use this to set where inside that object the result will be set. By default the result of the Task/Lambda replaces the model. If set as null the task's result will be…
Read More

OPENX EXCHANGE

Software Development, Web programming
Just add this bit of code to the httpClientHandler: // Return `true` to allow certificates that are untrusted/invalid httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; Full code example: var myPostObj = new {prop1 = 1, porp2 = 2}; using (var httpClientHandler = new HttpClientHandler()) { // Return `true` to allow certificates that are untrusted/invalid httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; using (var client = new HttpClient(httpClientHandler)) { var reqAsJson = JsonConvert.SerializeObject(myPostObj); var content = new StringContent(reqAsJson, Encoding.UTF8, "application/json"); var response = await client.PostAsync(url, content); return response; } }
Read More

NCORAI APP

Software Development
This has become so annoying I need to write it down in case I forget about it in the future (what's the point of the HTML editor if the HTML gets modified by wordpress?). When adding a piece of code you want to highlight with Syntax highlighter, best approach is: Click on the "+" of the block on the side, and search for "Custom HTML", select it.Now you can add your "csharp" "js" or "html" tags as you wish with the already tabbed lines of code inside.If you click on preview that little block (there's a button to do this) it won't make it, but ignore, it actually works once you preview the entire post or publish it. Some examples Html (sourcecode language="html") or (html) [sourcecode language="html"] <h2>Here goes a…
Read More

GUTTER CAT GANG EXCHANGES

gate.io login, Web programming
When getting error message: The SSL connection could not be established, see inner exception. Inner exception: The remote certificate is invalid according to the validation procedure. We need to add a client handler that will simply accept all certificates no matter what. [csharp highlight="6,7"] private static async Task<HttpResponseMessage> Request(object request, string url, string headerKey, string secret) { using (var httpClientHandler = new HttpClientHandler()) { // Return `true` to allow certificates that are untrusted/invalid httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; using (var client = new HttpClient(httpClientHandler)) { client.DefaultRequestHeaders.Add(headerKey, secret); var reqJson = JsonConvert.SerializeObject(request); var content = new StringContent(reqJson, Encoding.UTF8, "application/json"); var response = await client.PostAsync(url, content); return response; } } } [/csharp]
Read More

UNIBRIGHT 交易所

gate io app
Angular 2 handles sanitation using the DomSanitiser at platform-browser library, though this seems to have changed through versions this is the latest one: [js]import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';[/js] Can be used like this in code: [js] constructor(private sanitizer: DomSanitizer) { this.sanitizer.bypassSecurityTrustResourceUrl("www.example.com"); } [/js] Another way to achieve the same thing, using SecurityContext at angular/core: [js] import { Component, SecurityContext } from '@angular/core'; this.sanitizer.sanitize(SecurityContext.URL, "https://www.example.com"); [/js] Basically you can use sanitize adding the type of value you want to sanitise, or you can use the appropiate method for each type: [js] // Types SecurityContext.URL; SecurityContext.RESOURCE_URL SecurityContext.HTML SecurityContext.SCRIPT SecurityContext.STYLE // Methods this.sanitizer.bypassSecurityTrustUrl("url") this.sanitizer.bypassSecurityTrustResourceUrl("url") this.sanitizer.bypassSecurityTrustHtml("url") this.sanitizer.bypassSecurityTrustScript("url") this.sanitizer.bypassSecurityTrustStyle("url") this.sanitizer.sanitize(SecurityContext.URL, "url"); [/js] Adding URL to iframe There's two ways to bind the url into it: [html] <iframe class="video-iframe" [src]="getVideoUrl()"></iframe> <iframe class="video-iframe" src="{{getVideoUrl()}}"></iframe> [/html]…
Read More

FREE CRYPTO SIGN UP BONUS

Web design, Web programming
With so many components and pieces of code in an angular application, CSS, cascade styling, may not be so straightforward as styles may be loaded in different orders or affect other components when you less expect it. Though after 15+ years styling websites, I was more than used to organise my styles in a proper way to have everything working nicely. Or maybe I never had such a big website on my hands for this to be an issue. But now that styles are encapsulated in the component when you give it some, while very useful to specify local styling (which still inherits the global) it can become painful to then maintain some sense of cascading, like how to reference a style in the parent to determine your child's one.…
Read More

MAXIMUS TEAM 交易所

Web programming
Note: This was done for Angular 1, but Angular 2 is the same except the bit at the end of the post. Google ReCaptcha In order to include Google ReCaptcha in your website you need a Google account and get into the "Google ReCaptcha" web page. Once in there create a site and add your domain/s in there, recaptcha generates a key that's only valid for the included domains, and that affects localhost too, so in order to test in localhost you must include that domain in the list. As it would be a bad approach to use production keys to test in localhost domain (anyone could make use of your keys) the best approach is to not include localhost into your production site and create a different one with…
Read More

AVOCADOIO 交易所

Web programming
What is Blazor? It's a new .Net technology that allows to implement web's client side codes using C# and compiling to Web Assembly, a new web standard that all modern browsers implement (it's meant to be faster as it's compiled). It also makes use of the old Razor technology used at MVC views, that's why they've got similar names (Browser+Razor = Blazor). It allows you to create SPAs (Single Page Applications) using .Net technologies only, no javascript. Some notes Blazor is similar to Angular in which it allows you to create your own pieces of code, add them as HTML tags and include two-way data binding between the codes and the view. It seems very similar to Angular1 in how it achieves it and it doesn't seem very flexible on…
Read More

KMT COIN

Other, Web design
A few links to resources to build your own website FreeFrontEnd.com Website with free stuff to add to your website, like this list of CSS loaders. Unsplash A database with thousands of great Creative Commons photos free to use on your website. CodePen and jsFiddle Both are quite good online editors to test some stuff in a clean environment and even share such example with other devs. Json Formatter When you need to check a JSON object with tabbing, collapsing and colors, this quick online tool really helps.
Read More

GORILLA TOKEN EXCHANGE

Web programming, Web statistics
What is a Pardot form? Salesforce Pardot forms are a combo between a user tracking script that registers users navigation throughout your website and Form registration like the form-to-lead approach which does the same but without tracking data. What do I need? First of, you need to set the tracking code into your website, which you should be able to find at Salesforce. Then, you also need to set a form in your website to allow the users to register. This can be done in two ways: creating a form and its fields at Salesforce and attaching an iframe to your website with such form or with what's called form-handler: create your own form and "POST" it to Salesforce, which obviously is the way we devs do it ;) How…
Read More

REGEN NETWORK

Web programming
Fair warning AWS Services are in constant change and evolution. Check the date of this post as in the last 18 months there's been new stuff added to those services and I expect more to come in the next 18, so if the post is a bit out of date be careful it may not be accurate. Installing and using the AWS plugin Need to install "AWS Toolkit for Visual Studio 2017 and 2019" plugin into Visual Studio. Then, you should have an "AWS Explorer" tab on the sidebar next to the Solution Explorer and the rest where you can set up your credentials and log into Amazon. That panel will also show you all the lambdas and rest of stuff you already have in Amazon. You can also add…
Read More

BULLISH CRYPTO PATTERNS

Software Development, Web design, Web standards
Creating email templates can be a tedious task, with so many rules between different email readers, most of CSS not really working and us devs now so used to SASS and LESS, just the idea that they still use tables terrifies me a bit. There's the possibility of buying a template, but in my experience that may not be the best approach; companies that sell templates as a business model tend to obfuscate as much as possible of their product, and being HTML+CSS this means they will run some algorithm on it creating weird stylesheet keys and stuff just to make your editing life a painful hell. So the alternative, apart from creating a very simple and plain email, is to go opensource. Yes. There are some opensource email templates…
Read More
Close Bitnami banner
Bitnami