When you want to work with Ruby on Rails models, even if you’re just playing around, you have to go through a few steps: Create an app directory Create a database Generate model classes Run migrations But sometimes you need…
The post Active Record Without a Rails App appeared first on Treehouse Blog.
NPrinting is important for many users. In the 2017 June release, on-demand reporting is enabled with the NPrinting API. Immediately after the release, the above question was raised to me. I spent a few days trying to prototype a solution but ended up with something that is so simple that anyone can do it in 10 minutes. Frustrating? Yes, because I spent so much time on something that is just a little bit better than “Hello, World!” On the other hand, simple is awesome; simple means even a non-technical user can implement it without problem. Pretty cool.
With that, I’m sharing my experience in case I can help others stuck with a similar problem.
A filter in Crafter is a Groovy-based controller that allows you to intercept inbound requests for content and API responses and dynamically apply rules, modify the request or transform the response. A Crafter Filter has the same interface and mechanics as a Java J2EE Servlet Filter. Some examples of filter use are:
Apply security rules: Check for SAML2, Site Minder, or other security tokens before allowing the request to proceed.
Active Record: Example: before serving the requested resource, look up and load the user’s profile into the request so it is available to all components of the system.
Apply compression: Gzip all of the data returned by the requested resource (page, API, etc)
In this article, we’ll learn the specific mechanics of creating and configuring a filter in Crafter CMS.
Most of my articles are about WebDriver. Today, I am going to write about a common problem that people usually hit. Have you experienced this? Your tests finish and then all of a sudden, the browser is still opened? The next time you try to clean the build folder, you cannot because the current driver’s EXE is still in use. Such a pity. From now on, your builds start failing. Many people complain about the flakiness of WebDriver, and this is one of the reasons. Here, I am going to propose to you a solution: As they say in Mortal Kombat, “Finish Him!" (kill all of the processes).
Test C# Code
Once again, I will use one of my favorite test pages: Bing. Below, you can find the page object that we will use in the tests.
A DSL, or Domain Specific Language, is a language that has a specific purpose rather than a general purpose, like C or Java. One of the most popular DSLs is SQL because it’s the standard for querying a relational database and its syntax is specific to activities such as sorting, filtering, and displaying data.
SQL falls under the category of external DSLs, which means it requires its own parser and implementation of all of the necessary components. Other examples of external DSLs are Gherkin, for writing feature files, Make Files, for building C and C++ applications, and HTML, for declaring webpages).
One of the new hidden gems in the new CSS modules, which is supposed to drop in new browser versions in the future, is CSS containment. In this short post, I’ll explain what is the new contain property and why you will want to use it.
CSS Containment Module
The CSS containment module defines a new indication, using the contain property, that an element’s subtree is independent of the rest of the page. This will enable browsers to optimize the performance of rendering/painting.
In ES6, two types of literals were introduced:
Template Literals for string concatenation and expression embedding in a string
Tagged Template Literals to tag the Template Literal in a function so the literal can be evaluated in the function
Let’s assume that you need to do the string concatenation with a dynamic expression or with the value of a variable. Take a look at the following code:
This is Part 2 of our 2-part tutorial. RxJS Advanced Tutorial With Angular and Web Speech: Part 1 covered the following:
Introduction to reactive programming with Rx* and observables
Setting up our Angular app
Integrating the Annyang library for speech recognition support
Implementing a form component allowing users to speak or type words to use in the madlib story
In Part 2, we will cover:
Crafter CMS supports scripting in Groovy. It’s awesome. It’s lightweight. It’s fast. It’s easy. That said, when solutions start to become more sophisticated, developers need ways to manage the complexity. Spring bean factory is an inversion-of-control implementation that has become a standard for wiring components of a system together. Crafter CMS lets you create classes in Groovy and wire them together as Spring beans that can be used by other scripts in the system.
Step 1: Create Your Classes
Put your classes under scripts/classes/groovy. For example, you could put them under scripts/classes/groovy/mysite/AddressBook.groovy.