Create a “Hello world!” PHP script
lessonDuration 2m 1s
What's a tutorial without a hello world lesson? Let's learn about open and closing PHP brackets, and the "echo" language construct, which is perhaps the most-used construct in the language.
Browse
Find courses, lessons, articles, talks, and podcasts.
396 results for "most"
Showing 385–396 · Page 17 of 17
lessonDuration 2m 1s
What's a tutorial without a hello world lesson? Let's learn about open and closing PHP brackets, and the "echo" language construct, which is perhaps the most-used construct in the language.
lessonDuration 1m 16s
For the better portion of a decade, React has shipped with the `render` root API. This changes with React 18 — mostly. React 18 is a transitional release, supporting `render` (legacy root API) and `createRoot` (new root API). React 18's legacy root API operates exactly the same as v17.
lessonDuration 1m 21sFree
The [payloadCreator](https://redux-toolkit.js.org/api/createAsyncThunk#payloadcreator) argument to `createAsyncThunk` takes two arguments. The first is a single `arg` that receives data passed into the thunk's action creator such as `dispatch(checkout(items))`. The second is called `thunkAPI` that contains something [like 7 different methods on it](https://redux-toolkit.js.org/api/createAsyncThunk#payloadcreator). Here we're going to use its `getState()` method to access the global state just before we make complete the checkout API call. When it comes to typing `createAsyncThunk` just like other RTK methods, it will mostly be typed by default. In this case we still need to tell it about our store. We can do that with `thunkAPI.getState() as RootState` which I think is the preferred way to handle the types here. If we really want to be thorough though, we can pass in the full types like this: ```ts createAsyncThunk< PayloadResponse, ThunkArgument, { state: RootState } >("slice/typeName", payloadCreator) ```
lessonDuration 3m 8s
While we have `test_write_with_title` which tests the garden CLI with a given title flag, we can also set up additional tests, such as for using a written title in the document for the filename. Copy/pasting the code from test one into test two is a lot of duplication, and setting up the fake editor isn't going to change across tests, so let's abstract the creation of the temporary directory, the fake editor script path, and the `Command` itself into a utility function. The port is relatively straightforward, with the only changes being that we cut off the `cmd` modifications before the `.arg` calls, and now have to return the `cmd` and the `temp_dir` in a tuple. We return the actual `Command` and `TempDir`, yielding ownership to the calling function because we have no further use for them here, but the calling function will need to mutate the `Command` more, and use `TempDir` to test. ```rust fn setup_command() -> (Command, assert_fs::TempDir) { let temp_dir = assert_fs::TempDir::new().unwrap(); let mut cmd = Command::cargo_bin("garden").unwrap(); let fake_editor_path = std::env::current_dir() .expect("expect to be in a dir") .join("tests") .join("fake-editor.sh"); if !fake_editor_path.exists() { panic!( "fake editor shell script could not be found" ) } cmd.env("EDITOR", fake_editor_path.into_os_string()) .env("GARDEN_PATH", temp_dir.path()); (cmd, temp_dir) } ``` The new write tests are considerably shorter now and focus mostly on which subcommand to call, and what the user interaction with that subcommand is. ```rust fn test_write_with_title() { let (mut cmd, temp_dir) = setup_command(); let assert = cmd .arg("write") .arg("-t") .arg("atitle") .write_stdin("N\n".as_bytes()) .assert(); assert.success(); temp_dir .child("atitle.md") .assert(predicate::path::exists()); } fn test_write_with_written_title() { let (mut cmd, temp_dir) = setup_command(); let assert = cmd .arg("write") .write_stdin("N\n".as_bytes()) .assert(); assert.success(); temp_dir .child("testing.md") .assert(predicate::path::exists()); } ```
talk
Why are we afraid to deploy our app on Friday evening? Well, mostly because no one wants to debug production issues on Saturday and we really want to go home. Answering the (seemingly) basic question of "does our code actually work?" is surprisingly difficult at times. In this talk I'd like to cover different approaches we, JavaScript developers, can embed into our toolkit to make our lives easier and our users happier (hint: unit tests are not enough). [Link to slides](https://tlakomy.github.io/sleeping-better-at-night/assets/player/KeynoteDHTMLPlayer.html#0) [Link to talk notes](https://github.com/eggheadio/eggheadio-course-notes/tree/master/egghead-talks-sleeping-better-at-night)
lessonDuration 7m 19sFree
In this video lesson, you will add Chakra UI component library to ease development of UI components. After all we want to focus mostly not on styling, but on implementing video processing functionality
lessonDuration 1m 54s
Thanks for watching my advanced javascript fundamentals course! This course has been really fun to put together and is a subject close to my heart. Not just because I love Javascript but because I came from a mostly self-taught background. A lot of these concepts were a mystery to me for far too long in the beginning of my career. Also, I often see many of these concepts tripping up developers today… especially in edge case scenarios or during interviews. My hope is that I can save you from a lower salary offer, not getting a job, debugging a difficult code bases, and actually help you write cleaner code. Sure knowing these concepts are not required to use React, Angular, Vue, or just JavaScript in general, but I firmly believe that these advanced fundamentals can make a significant impact in your career.
lessonDuration 3m 40sFree
Components are at the core of building applications with React. In this lesson, we'll start with some static JSX markup and refactor it into a component that can be reused. We'll see how a React component is mostly "just JavaScript" when we use a JavaScript function to create that component. We'll also look at props in React and how we use props to configure specific instances of a component.
lessonDuration 3m 7sFree
Instead of multiple `useState` hooks, you can use a single `useReducer` hook to manage multiple pieces of data in a React component. This will feel very similar to Redux, but it will be defined for only a single component. This can trade off some of the complexity of using multiple `useState` hooks, but it just moves that complexity into the reducer function - so using `useReducer` vs multiple `useState` calls is mostly just a code style choice.
lessonDuration 5m 9sFree
Nuestro componente wizard implementa el patrón state reducer y expone varios hooks personalizados para permitir al usuario definir como utilizar el componente, es decir, nuestro Wizard sólo define la lógica básica de su funcionamiento. Por medio del patrón state reducer, nuestro Wizard expone acceso al estado interno permitiendo crear lógica personalizada que permite utilizar el componente para realizar otras acciones. En este caso se agrega una nueva acción al reducer y un nuevo estado que permiten obtener los datos de un comic de XKCD para mostrarlo en una de las páginas del Wizard, y también modifica los controles de navegación permitiendo avanzar a la siguiente página utilizando el botón de búsqueda.
lessonDuration 2m 45s
Insertion sort is another sorting algorithm that closely resembles how we might sort items in the physical world. We start at the second item in our collection and make the assumption that this item is a sorted list of length 1. We then compare all the items before it and determine if it needs to be "inserted" to the left or right of our item. We then move onto the second item, again comparing it to every item before it in the list, inserting those items correctly. Because this algorithm requires two loops, one inside the other, the worst case scenario of our algorithm still requires a time complexity of `O(n^2)`. This is also an inefficient sorting algorithm, but if our list is mostly sorted already, it will perform a slight bit better than bubble sort.
lessonDuration 4m 44s
Refactoring streams in RxJS is mostly moving pieces of smaller streams around. This lessons demonstrates a simple refactoring by requiring the StopWatch to be more configurable.