Ruby: Generating and parsing JSON, or: understanding JSON::ParserError "unexpected token"

Posted About 3 years ago by Dominik Schöler.

json is part of the standard library of Ruby and deals with JSON, obviously. As you know, JSON is the...

Some tips for upgrading Bootstrap from 3 to 4

Posted About 3 years ago by Florian Leinsinger.
getbootstrap.com

Recently I made an upgrade from Bootstrap 3 to Bootstrap 4 in a bigger project. Here are some tips how...

WYSIWYG with Action Text

Posted Over 3 years ago by Niklas Hasselmeyer.

Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that...

Git: Parsing large diffs as a human

Posted Over 3 years ago by Michael Leimstädtner.

I just finished migrating a project from the Asset Pipeline to Webpacker, this is what my diff to master looks...

How to build a fully custom TinyMCE 5 dialog

Posted Over 3 years ago.

TinyMCE is a WYSIWYG editor which is quite customizable. Add a custom button to the tinyMCE toolbar and tell tinyMCE...

A few recent CSS properties

Posted Over 3 years ago by Dominik Schöler.

Feature Queries (Edge 12+): Similar to @media queries, @supports blocks can be scoped to browsers that support a given declaration...

Configuring Webpacker deployments with Capistrano

Posted Over 3 years ago by Dominik Schöler.

When deploying a Rails application that is using Webpacker and Capistrano, there are a few configuration tweaks that optimize the...

Passive event listeners may speed up your scroll and touch events

Posted Over 3 years ago by Michael Leimstädtner.
github.com

Scroll and touch event listeners tend to be computationally expensive as they are triggered very often. Every time the event...

Service Worker series by GoMakeThings

Posted Over 3 years ago by Dominik Schöler.
gomakethings.com

Learn how to create offline applications with service workers. The amazing power of service workers Writing your first service worker...

Chrome Lighthouse

Posted Over 3 years ago.
developers.google.com

Chrome has a built-in utility to check performance and accessibility (and more) of your web app: Lighthouse.

Webpacker: Disable source maps

Posted Over 3 years ago by Henning Koch.
webpack.js.org

You can do this per environment, e.g. in config/webpack/test.js: const environment = require('./environment') const config = environment.toWebpackConfig() config.devtool = 'none' module.exports = config

How to migrate CoffeeScript files from Sprockets to Webpack(er)

Posted Almost 4 years ago by Michael Leimstädtner.

If you migrate a Rails application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript...

Vortrag: Content Security Policy: Eine Einführung

Posted Almost 4 years ago by Tobias Kraze.

CSP hat zum Ziel einen Browser-seitigen Mechanismus zu schaffen um einige Angriffe auf Webseiten zu verhindern, hauptsächlich XSS...

Automatically validating dependency licenses with LicenseFinder

Posted Almost 4 years ago by Dominik Schöler.

"Open-source software (OSS) is great. Anyone can use virtually any open-source code in their projects." Well, it depends...

Shorthand function properties in ES6

Posted Almost 4 years ago by Henning Koch.

Here is an ES5 object literal with two string properties and a function property: let user = { firstName: 'Max', lastName: 'Muster...

The HTML5 video element

Posted Almost 4 years ago by Dominik Schöler.

# Basic HTML example # Javascript API (notable methods and properties) video = document.querySelector('video') video.play() video.pause() video.load() // Reset to the beginning and...

Merging two JavaScript objects

Posted Almost 4 years ago by Henning Koch.

Let's say you want to merge the properties of two JavaScript objects: let a = { foo: 1, bar: 2 }

HTTP Client in RubyMine

Posted Almost 4 years ago by Martin Schaflitzl.

RubyMine has a HTTP Client that can be useful to test web APIs. Just create a .http scratch file an...

Select2 alternatives without jQuery

Posted Almost 4 years ago by Henning Koch.

Select2 is a fantastic library for advanced dropdown boxes, but it depends on jQuery. Alternatives Tom Select

Howto: Select2 with AJAX

Posted Almost 4 years ago by Florian Leinsinger.
select2.org

Select2 comes with AJAX support built in, using jQuery's AJAX methods. ... For remote data sources only, Select2 does not...

Testing for XSS in Markdown Fields

Posted Almost 4 years ago.
github.com

If you render markdown from user input, an attacker might be able to use this to inject javascript code into...

Error handling in DOM event listeners

Posted Almost 4 years ago by Henning Koch.

When an event listener on a DOM element throws an error, that error will be silenced and not interrupt your...

The JavaScript Object Model: A deep dive into prototypes and properties

Posted Almost 4 years ago by Henning Koch.

Speaker today is Henning Koch, Head of Development at makandra. This talk will be in German with English slides.

How to evaluate CSS media queries in JavaScript

Posted Almost 4 years ago by Henning Koch.

To make CSS rules dependent on the screen size, we use media queries: @media (max-width: 500px) { // rules for screen...