Create a Boolean variable in PHP
lessonDuration 3m 28s
Booleans toggle variables to true or false, depending on the outcome of the expression. You can also negate values, which reverses the polarity of the PHP variable.
Browse
Find courses, lessons, articles, talks, and podcasts.
193 results for "express"
Showing 145–168 · Page 7 of 9
lessonDuration 3m 28s
Booleans toggle variables to true or false, depending on the outcome of the expression. You can also negate values, which reverses the polarity of the PHP variable.
lessonDuration 1m 27sFree
Binding is a core feature of AngularJS. It provides a simple mechanism for integrating your HTML with your data via {{bracketed expressions}}. In this video, John covers the basics of binding to get you started.
lessonDuration 3m 53s
We are going to start refactoring our `CountDisplay` component. It is a small stateless component but it has a few props that can benefit from type safety. There are three ways to type a component, inline, alias, and as a function expression. The inline typing adds a bit of noise to our code and can make it difficult to parse right out of the gate. To fix this, we use a type alias that reads a little bit nicer. To add in a function expression, which we get from the React Types that we downloaded, we can declare this variable to have a type of `React.FunctionComponent` which takes as a type argument, our props.
lessonDuration 7m 38s
Continuing with building our GraphQL CRUD API, we now need a way to update an item. We'll do this by using a mutation. DocumentClient update expressions are cumbersome, instead of writing them ourselves, we are going to install the **[dynoexpr](https://github.com/tuplo/dynoexpr)** library that will generate them for us. But, in order to be able to bundle the third-party package into our lambda function, we will use the **[Amazon Lambda Node.js Library](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html)**
lessonDuration 3m 19sFree
It’s awesome that we can interact directly with React’s `createElement` API to create React elements and then hand those off to React DOM to get them to show up on the screen. But it’s not the most ergonomic API to write our UI code in. It’s hard to track when one element starts and the next one ends. This is why the React team came up with JSX. It’s an extension to the JavaScript language to support syntax that looks similar to the HTML that you would write to create these DOM elements (there are [a handful of differences](https://reactjs.org/docs/dom-elements.html)). JSX gives us an expressive syntax for representing our UI, without losing the benefits and powers of writing our UI in JavaScript. The best way to take advantage of this is to learn how JSX is compiled to regular JavaScript calls, so we’ll look into that a bit as well.
lessonDuration 5m 43s
We take the opengraph image we wrote in codesandbox and copy it into our serverless function. We use Rollup to compile the component into an IIFE (immediately invoked function expression) that can run in our headless browser environment and cover a wide set of rollup plugins that we need for compatibility. We end the lesson having successfully screenshot our opengraph react component from our Netlify Function **Note**: Due to Netlify changing their handling, the path in `fs.readFileSync` is affected. Update to: ```js const script = fs.readFileSync(path.resolve(__dirname, "image.js"), "utf-8"); ```
lessonDuration 7m 13sFree
This lesson introduces the `?.` operator which is known as [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). We're going to look at how we can use `?.` to safely descend into an object with properties which potentially hold the values `null` or `undefined`. We're also going to learn how to access properties with an expression using the `?.[]` bracket notation and how to call functions which may not exist using the `?.()` syntax.
lessonDuration 2m 29s
A `const` assertion is a special type assertion that uses the `const` keyword instead of a specific type name. When using a `const` assertion on an object literal expression, all properties will become `readonly` properties and no literal types within the expression will be widened. ## Additional Reading - [Const Assertions in Literal Expressions in TypeScript](https://mariusschulz.com/blog/const-assertions-in-literal-expressions-in-typescript) - [Literal Type Widening in TypeScript](https://mariusschulz.com/blog/literal-type-widening-in-typescript)
lessonDuration 2m 14s
A `const` assertion is a special type assertion that uses the `const` keyword instead of a specific type name. When using a `const` assertion on an array literal expression, the resulting type will be a `readonly` tuple type and no literal types within the expression will be widened.
lessonDuration 1m 30s
We'll replace the `println!` macro with a call to `todo!`, which has the additional benefit of type-checking so we won't need to finish anything with `todo!` in the expression. Note that if we call a function with `todo!`, we do get the `panic!` behavior. We do have two other options for achieving the same thing, `unimplemented!` and `panic!`. All three of these options functionally do the same thing: they crash the program immediately. We aren't using `panic!` because `panic!` should be used when a program reaches an unrecoverable state. We don't have an unrecoverable state so much as a piece of the program we intend to work on later. For similar reasons, we aren't using `unimplemented!` because we want to convey that this is something to work on while `unimplemented!` doesn't necessarily mean that we intend to work on it.
lessonDuration 2m 34sFree
One of the fundamental aspects of Javascript is variable scope, and in this lesson we'll dive into how variable scope works when defining variables with `var`, `let`, or `const`. The three main takeaways are: 1. Inner scope can always read values defined in an outer parent scope. 2. Outer scope **cannot** read values defined in an inner scope (except when defined with `var`). 3. The `var` scope-bleed issue can be overcome using immediately-invoked function expressions (IIFEs).
lessonDuration 2m 43sFree
FQL is the main query language for interacting with FaunaDB. It supports all JSON types, plus some additional types like Ref, Date, and Set. FQL is based in expressions and as such everything returns a value. This makes it easy to compose logic into larger queries. Code shown in the shell: ``` Match(Index("all_customers")) ```
lessonDuration 1m 46sFree
AWS Lambda functions can be triggered by a number of sources, for instance an asynchronous HTTP request. We may want to be a bit more synchronous - for instance trigger a function every X minutes, hours or days. In this lesson we're going to build a simple "clock" function which is going to log the current time to CloudWatch logs every minute using rate expressions
lessonDuration 3m 13sFree
YugabyteDB is an open source, high-performance distributed SQL database for powering global, internet-scale applications. The Yugabyte Structured Query Language (YSQL) is the distributed SQL API for YugabyteDB and is compatible with the SQL dialect of PostgreSQL. Currently, YSQL is compatible with PostgreSQL 11.2 version. YugabyteDB and YSQL are optimized for RDBMS workloads that need horizontal write scalability and global data distribution while also using relational modeling features, such as JOINs, distributed transactions, and referential integrity (such as foreign keys). The main components of YSQL include the data definition language (DDL), the data manipulation language (DML), and the data control language (DCL). A number of elements are used to construct these components, including data types, database objects, names and qualifiers, expressions, and comments. Other components are also provided for different purposes such as system control, transaction control, and performance tuning. In this lesson we will see how we can connect and work with YugabyteDB YSQL shell on a local cluster running on MacOS.
lessonDuration 3m 12s
When combining two broadcasters it also makes sense to output both of the values as a single state object so our operators can have complete control over how the values come through. This saves us from worrying about keeping values in sync especially when we use something like a repeat operator that tells the original broadcaster to cancel and start over. In our scenario, the mapping logic for I game can easily be expressed inside of the JSX If we have both the most recent value of the guess out of the word.
lessonDuration 2m 37s
In this lesson we'll briefly discuss the concept of Ownership and Borrowing in Rust, and how expressions can be passed by value and by reference.
lessonDuration 7m 2s
One of the killer apps of CLIs is with templating (or scaffolding). The `rails generate` and `ng generate` commands are famous for this. By immediately reducing the pain of boilerplate, you can also make it easy to write standardized code, with in-place reminders for comments and developer warnings (it is easier to delete generated code than write code, though of course one can overdo it). There is no standardized tooling for doing scaffolding, since you can use everything from the Express.js templating languages to writing your own, but we explore this problem space with the tiny `copy-template-dir` library to prove out the developer experience of adding scaffolding to your CLI.
lessonDuration 1m 11s
An IIFE (immediately invoked function expression) is when a function is called immediately after it is defined. These functions are defined and called once and are not accessed by other functions, variables, or from the global namespace. This is because it uses the grouping operator to make these function declarations an expression. Because of this one time invocation and lack of accessibility, we can use their function scope to hide variables from being access from anywhere else.
lessonDuration 2m 21sFree
FQL is the main query language for interacting with FaunaDB. It supports all JSON types, plus some additional types like Ref, Date, and Set. FQL is based in expressions and as such everything returns a value. This makes it easy to compose logic into larger queries. Code shown in the shell: ``` Match(Index("all_customers")) ```
lessonDuration 3m 21s
The passing of time can be represented as an event in XState. Rather than requiring the user to send an event after an amount of time has passed, XState provides the `after` property. The value of `after` is an object whose keys are the milliseconds that should pass before a transition is taken. Consider a stop light transitioning from yellow to red after three seconds: ```javascript //... yellow: { after: { 3000: 'red' } }, red: { //... } //... ``` We can also create dynamic delays with expressions using the `options` object as the second argument to `Machine`. This is also demonstrated in the lesson.
lessonDuration 1m 33s
A small caveat with Immer is that arrow functions that consist of just an expression, and not a function block, always return a value. In this lesson we will show that in these cases the `void` keyword can be used to avoid accidentally returning new state in addition to modifying the draft.
lessonDuration 1m 31sFree
In this lesson, we learn how the `x-init` directive in Alpine JS lets us run a JavaScript expression once the component has initiated. We see the nuances that allow us to trigger that code before Alpine performs initial DOM updates, or after these updates have been made.
lessonDuration 4m 53sFree
This lesson shows how to use the `serbet` npm package to write a simple Node.js http server in ReasonML by implementing a simple "hello world" endpoint. Serbet is a convenient wrapper around Express.js. It's a young library, but its patterns are already used in production code.
lessonDuration 3m 57s
We refactor a function that uses try/catch to a single composed expression using Either. We then introduce the chain function to deal with nested Eithers resulting from two try/catch calls.