The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Web Development’ Category

Location, location

Posted by jpluimers on 2018/01/26

This is why I try to avoid doing web-development: [WayBack] Location, location: location = location … and a 534 other ways to reload the page with JavaScript.

Via [WayBack] location = location … and a 534 other ways to reload the page with JavaScript – ThisIsWhyICode – Google+

–jeroen

Posted in Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »

badssl.com

Posted by jpluimers on 2018/01/11

I wish I had bumped into this when it got released in 2015: [WayBackbadssl.com hosted in the cloud and maintained by two people from Google and Mozilla.

Where ssllabs.com is for checking server-side certificates, this one is for checking clients against many, many (did I already write MANY?) server side configurations both good (with a varying set of security settings like cyphers and key exchanges) and bad.

One of the bad ones is expired.badssl.com which your clients should not be able to connect to without throwing a big error.

Sources are at [WayBack] GitHub – chromium/badssl.com: Memorable site for testing clients against bad SSL configs.

Before using, please read their

Disclaimer

badssl.com is meant for manual testing of security UI in web clients.

Most subdomains are likely to have stable functionality, but anything could change without notice. If you would like a documented guarantee for a particular use case, please file an issue. (Alternatively, you could make a fork and host your own copy.)

badssl.com is not an official Google product. It is offered “AS-IS” and without any warranties.

–jeroen

Posted in Communications Development, Development, HTTP, https, Internet protocol suite, Security, Software Development, TCP, TLS, Web Development | Leave a Comment »

Reminder to self – Fiddler for OS X Beta

Posted by jpluimers on 2018/01/11

Reminder to self: [WayBackFiddler for OS X Beta as it’s been on my list since about a year ago: Fiddler for OS X Beta « The Wiert Corner – irregular stream of stuff.

Note that reading the cerficicates can be done in a more simple way for the Current version of Mono:

/Library/Frameworks/Mono.framework/Versions/Current/bin/mozroots --import --sync

I forgot in which version the Mono installer has Current linked to the most recently installed Mono version but it works well.

Executing should then be somethig like this:

/Library/Frameworks/Mono.framework/Versions/Current/bin/mono ~/bin/fiddler-mac/Fiddler.exe

I expect quite some bit of trouble decrypting HTTPS [Arvhive.is] as that was troublesome on Windows in the early Fiddler days as well.

In case of trouble, there is always Fiddler IdeasCustomer Feedback for Fiddler by Telerik . Add a new product idea or vote on an existing idea using the Fiddler by Telerik customer feedback form via [WayBackTsviatko Yovtchev: “@jpluimers @ericlaw https://t.co/lRNXC88M1b is our feature suggestion/issue tracker portal. Fiddler itself notifies on new versions.”

Back to the reminder: [WayBack] Fiddler for OS X Beta.

Direct download https://telerik-fiddler.s3.amazonaws.com/fiddler/fiddler-mac.zip.

Downloading Fiddler for OS X Beta…

If your download does not start, please [WayBackclick here to retry


Getting started

  1. If you don’t have the Mono framework installed on your Mac

    Please download it from [WayBackhttp://www.mono-project.com/download/#download-mac and install it. If you already have it installed, ensure you’re running the latest version.

  2. If you just installed Mono

    Please open Terminal and type in:

    /Library/Frameworks/Mono.framework/Versions/<Mono Version>/bin/mozroots --import --sync

    (The Mono framework has its own trusted root certificates store. Currently (at mono version 4.2.4) this store remains empty after installing Mono on OS X. Fiddler uses the certificates in this store to validate the certificates of the websites visited. So you need to populate this store with a set of commonly trusted root authorities to avoid getting constant certificate warnings from Fiddler. The mozroots tool imports trusted authorities from the Mozilla LXR. )

  3. Extract fiddler-mac.zip to a folder you have write access to.

    It is recommended that the full path to Fiddler install folder does not contain any Windows path illegal characters. (At present it is possible that some Fiddler functionality, e.g. various file exports or Fiddler Script won’t handle such paths.)

  4. Open Terminal and navigate to the folder you extracted to in step 3.

  5. Type mono Fiddler.exe in Terminal.

To further understand the benefits and limitations of Fiddler for OS X please visit [WayBackthis blog post.

–jeroen

Posted in Development, Fiddler, Software Development, Web Development | Leave a Comment »

How to make an iframe fit or fill 100% of its container’s remaining height – Sikwati

Posted by jpluimers on 2017/12/20

There are a lot of suggested solutions out there: mostly not working when I tried them, and some required several lines of code which seems unnecessary for such a simple issue.

[WayBackHow to make an iframe fit or fill 100% of its container’s remaining height – Sikwati

He made a lot of effort to get to this simple construct:


<iframe src="/sample.pdf" width="100%" style="height: 100vh;"></iframe>

I tried it at the [WayBackSpring4d generated documentation and it seems to work fine:

Read the rest of this entry »

Posted in Development, HTML, HTML5, Software Development, Web Development | Leave a Comment »

301 & 302 Redirect Generator Tool

Posted by jpluimers on 2017/12/19

[WayBack301 & 302 Redirect Generator Tool is a simple and cool tool:

Generate code to permanently or temporarily redirect your old URL to a new URL using htaccess, PHP, HTML, JavaScript, ASP or ASP.Net

Although using .htaccess files requires Apache to allow AllowOverride All which you might not want to, so here are a few other options and links you might want to check out:

–jeroen

Posted in *nix, Apache2, Development, HTML, HTML5, Power User, Software Development, Web Development | Leave a Comment »

Some Atom.io packages I have installed for html editing

Posted by jpluimers on 2017/12/19

These packages come in for HTML editing in Atom.io:

A few more ideas:

–jeroen

 

Posted in Development, HTML, HTML5, Software Development, Web Development | Leave a Comment »

Yay! The WordPress.com Press-This bookmarklet now works again!

Posted by jpluimers on 2017/11/29

Good news the Press-This bookmarklet on WordPress.com has been reinstated.

See https://github.com/WordPress/press-this/pull/29 and the discussions in these below threads and sources.

Solves issues:

  • #12 – Add text domains
  • #15 – Restore Bookmarklet Functionality
  • #17 – Needs better documentation
  • #32 – The Press This bookmarklet itself on the tools page does not have the code

Some relevant sources:

Read the rest of this entry »

Posted in Bookmarklet, Development, Power User, SocialMedia, Software Development, Web Browsers, Web Development, WordPress, WordPress | Leave a Comment »

HTML indentation: 2 spaces

Posted by jpluimers on 2017/10/12

Using too many editors in too many environments, tabbed files usually kills my productivity.

Not just because the structure of the indented code, also because most editors are stupid enough to also use tabs beyond the indentation, for instance for carefully aligned initialisation statements.

Changing the tab-size effectively waves good bye to those.

It’s weird (Wiert loves that word) that HTML peeps even argue about tabs versus spaces:

Most people still use HTML for pixel perfect rendering and spaces help getting character perfect rendering of the source code.

I was glad to bump into [WayBackJefferson Lima answering this on Stack Overflow:

The Google HTML/CSS Style Guide and the W3School HTML(5) Style Guide recommend 2 spaces.

This article also brings an analysis of the effect of tabs vs spaces in the resulting file size.

Source: [WayBack] html5 – html indenting standard, tab or two spaces? – Stack Overflow

So: use 2 spacec for HTML indent.

It doesn’t really matter in transmitted size (minified compressed transfer difference is ~0% and the usual image bloat is way larger than the HTML anyway – just try www.webbloatscore.com and watch).

References:

  • Indent by 2 spaces at a time.
  • Don’t use tabs or mix tabs and spaces for indentation.

Source: [WayBackGoogle HTML/CSS Style Guide

  • Do not add blank lines without a reason.
  • For readability, add blank lines to separate large or logical code blocks.
  • For readability, add two spaces of indentation. Do not use the tab key.
  • Do not use unnecessary blank lines and indentation. It is not necessary to indent every element.

Source: [WayBackHTML5 Style Guide

Tabs Spaces Saving
Raw file size 1403 bytes 1703 bytes 300 bytes/18%
Raw file GZipped   327 bytes   332 bytes      5 bytes/1.5%
Raw file minified 1199 bytes 1199 bytes      0 bytes/0%
Minified & GZipped   312 bytes   312 bytes      0 bytes/0%

When minified, it doesn’t matter if tabs or spaces are used, since they are all stripped away.

Source: [WayBackEffect of tabs vs. spaces in HTML files

–jeroen

Posted in Development, HTML, Software Development, Web Development | Leave a Comment »

How do I make the first letter of a string uppercase in JavaScript? – Stack Overflow

Posted by jpluimers on 2017/10/11

I’m a JavaScript n00b, so I like solutions like these:

Another solution:

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

You could also add it to the String.prototype so you could chain it with other methods:

String.prototype.capitalizeFirstLetter = function() {
    return this.charAt(0).toUpperCase() + this.slice(1);
}

and use it like this:

'string'.capitalizeFirstLetter() // String

Thanks [WayBackHutch Moore and [WayBackDeviljho for answering at [WayBackHow do I make the first letter of a string uppercase in JavaScript? – Stack Overflow!

Note you can do it in CSS too as explained by [WayBacksam6ber:

In CSS:

p:first-letter {
    text-transform:capitalize;
}

–jeroen

Posted in CSS, Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »

Twitter image size suffixes – via: Making silly #latex jokes is much more fun than doing final tweaks in my thesis on #coeffects…

Posted by jpluimers on 2017/08/18

Twitter stores images on twimg.com in various sizes.

You specify the size by adding a colon plus suffix to the URL. No colon plus suffix means a default size.

Suffixes you can use see to come from the media entity in Entities in Objects | Twitter Developers:

  • thumb
  • small
  • medium
  • large

There is one undocumented size: orig

The default size seems to be medium.

Examples (full images below):

media entity observed size URL
thumb 150×150 https://pbs.twimg.com/media/CiMNh9rWEAAdM6Q.png:thumb
small 340×325 https://pbs.twimg.com/media/CiMNh9rWEAAdM6Q.png:small
medium 600×573 https://pbs.twimg.com/media/CiMNh9rWEAAdM6Q.png:medium
(none) 600×573 https://pbs.twimg.com/media/CiMNh9rWEAAdM6Q.png
large 1024×979 https://pbs.twimg.com/media/CiMNh9rWEAAdM6Q.png:large
orig 1600×1529 https://pbs.twimg.com/media/CiMNh9rWEAAdM6Q.png:orig

Thanks to Thomas Petricek [WayBack] who poked fun last year on Twitter [WayBack] at both LaTeX and O RLY (the image meme [WayBack], not the text meme)

--jeroen

Read the rest of this entry »

Posted in Development, SocialMedia, Software Development, Twitter, Web Development | Tagged: , | Leave a Comment »