04 2017 档案
摘要:import { TestBed, ComponentFixture } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; import { Fil...
阅读全文
摘要:import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'filesize' }) export class FileSizePipe implements PipeTransform { transform(size: number, extension: string = 'MB') { retu...
阅读全文
摘要:In this lesson, we will use Chai's request method to test our Node application's API responses.By the end of this lesson, you will know how to:- insta
阅读全文
摘要:Say you have an array that has at least one item repeated. How would you find the repeated item. This is a question commonly presented to beginner dev
阅读全文
摘要:Define a auxilliary router: HTML: Routing by routerLink: Clean auxiliary router: Routing by JS: RouterLink's advantage: Angular will convert routerLin
阅读全文
摘要:First, start the env: Then cd to our module Create a new app: Create a api.py inside auth_api folder: auth_api/serialilzer.py auth_api/urls.py: top le
阅读全文
摘要:export class MailFolderComponent implements OnInit{ title: Observable; messages: Observable; constructor( private route: ActivatedRoute ){ } ngOnInit() { this.messages = thi...
阅读全文
摘要:In this lesson, we will look at docker container prune to remove old docker containers. We can also use docker system prune to clean up any containers
阅读全文
摘要:We can compose lenses to get value:
阅读全文
摘要:In this lesson we will cover how to build your own custom Docker image from scratch. We'll walk through the process of starting a Debian container, in
阅读全文
摘要:Copy/pasting the same code is redundant and updating copy/pasted code slows development velocity. Mixins are reusable chunks of code that are included
阅读全文
摘要:For example, we have a component which just simply render router-outlet: We can add events to router-outlet: When we log out the, we see the actual co
阅读全文
摘要:In our root component, one thing we can do is subscribe to Router events, and do something related to router events. So how can we get router event? T
阅读全文
摘要:To enable router tracing is really simple: When we define the root RouterModule, we can pass the option "enableTracing". What we you get is when we na
阅读全文
摘要:Add 'stage' which we can know what is the progress in a high level way: 'sh' is for any shell commands. Pipeline is written in Rudy, so can use rudy s
阅读全文
摘要:Learn the basic syntax for using grep to search the contents of a single file or files. It's like CMD+F, but better! You'll be able to quickly see all
阅读全文
摘要:We can create volumn to keep the data, even we stop the container and restart again, the data won't get lost. To create a link between the folder /my-
阅读全文
摘要:If you want to get into container and look around, you can use: to run against a running container. And to do that, we need to know the id / name of t
阅读全文
摘要:In this lesson we'll take a stateful React component and look at how we can refactor our setState calls to use an updater function and then leverage R
阅读全文
摘要:In this lesson, we'll refactor a React component to use Ramda lenses to update our component state. We'll create a lens to focus on the property we wa
阅读全文
摘要:We will use demo project as an example, go though QuickStart repo. Install: First you should have python & pip installed on your machine, then install
阅读全文
摘要:Do you have a standard workflow that involves setting up a specific tmux layout, or running certain commands? By writing tmux scripts, you can automat
阅读全文
摘要:We look at the default Array.prototype.sort behavior and discuss how you can do case insensitive string sorting.
阅读全文
摘要:In this lesson we cover the key reason why programming languages need generics. We then show how use them effectively with TypeScript. We show plenty
阅读全文
摘要:Learn how to use find to identify filenames matching specified patterns. We'll use find to identify all .jsx files in a directory, or all test files i
阅读全文
摘要:Rename your local foo branch with bar: Remember this will add the new branch when you push, but it won’t delete the old foo remote branch. Add -f --mi
阅读全文
摘要:To build rest api easily, we can use ModelViewSet from rest_framework. It provides GET, POST, DELETE, PUT methods. To render those model view set, you
阅读全文
摘要:When developing responsive websites, you will constantly be resizing your browser to make sure your site is properly responding to all of the resizes.
阅读全文
摘要:Testing your sites on mobile devices is a critical part of the development process. Webpack dev server enables you to visit the server from any device
阅读全文
摘要:We can use javascript for color and opacity variations, math, list and map logic or to see if something exists. SCSS includes functions for a wide ran
阅读全文
摘要:In this lesson, we will look at Greensock's Draggable API. We will implement a scrollable <div>container and explore some options available. DOC
阅读全文
摘要:import React from 'react' const Release = React.createClass({ render() { const { title, artist, outOfPrint } = this.props.release; const className = outOfPrint? 'release outOfPri...
阅读全文
摘要:In this lesson, we'll look at how to manage your history between tmux sessions, and ensure that your setup preserves your bash history between multipl
阅读全文
摘要:Creating custom validators is easy, just create a class inject AbstractControl. Here is the form we want to validate it: We put two custom validators
阅读全文
摘要:By using ssh, you can share a tmux session, making pair programming much easier. We'll learn how to share a tmux session with another user. For one de
阅读全文
摘要:We'll learn how to use mouse mode in tmux, including enable mouse control for resizing, scrolling and selecting panes. We'll also set keybindings in o
阅读全文
摘要:SCSS nesting can produce DRYer code by targeting child elements without having to write the parent class. Nesting up to 3 levels deep can help us unde
阅读全文
摘要:One of the most important thing when building custom form component is adding accessbility support. The component should be focusable. we can achieve
阅读全文
摘要:One non-obvious, but extremely useful, feature in tmux is copy-pasting text between panes. This also allows you to scroll back in a tmux sessoin. We'l
阅读全文
摘要:You can modify tmux's behavior with your tmux configuration file, .tmux.conf. You can use your tmux config to change color schemes, set custom keybind
阅读全文
摘要:Sometimes you'll want to zoom in on a specific pane within a tmux window. We'll learn to use C-b z to temporarily zoom in on one pane, as well as how
阅读全文
摘要:It's a lot easier to manage your tmux session when they have sensible names. We'll cover: How to create a new, named tmux session with tmux new -s Ren
阅读全文
摘要:In this lesson, we'll learn how to detach from a running tmux session and leave it running in the background. Then, we can re-attach to it later. We'l
阅读全文
摘要:In tmux, a window is a collection of panes. Creating multiple windows is a great way to organize your workspace. In this lesson, we'll cover: How to c
阅读全文
摘要:Learn to organize your workspace using tmux. We'll create a new tmux session and learn how to create and navigate panes within a tmux window. We'll co
阅读全文
摘要:After installing the jenkins, we start creating new job. 1. Give job names (your project name): 2. Go to "Source Code Management tab": Connect to sour
阅读全文
摘要:So when you need to create a ControlValueAccessor? When you want to use a custom component as form control. For example a counter component, you can c
阅读全文
摘要:Tired of dealing with monolithic CSS files? Are requests for multiple CSS files hurting your performance? In this lesson we learn how to separate our
阅读全文
摘要:justify content contol how element inside flex box align, it can be "right / end", or "left / top". or "center", or "space-around" or "space-between".
阅读全文
摘要:flex-direction: main two 'row' or 'column', you can use reverse also.
阅读全文
摘要:Function composition allows us to build up powerful functions from smaller, more focused functions. In this lesson we'll demystify how function compos
阅读全文
摘要:Building responsive css layouts is critical in any modern website. Tachyons makes this easy by designing for mobile first then enabling you to switch
阅读全文
摘要:We can specify grid columns, rows, and areas in one property using the grid-template shorthand. The same as:
阅读全文
摘要:A grid item can also be a grid container! Let’s see how to specify a grid within a grid.
阅读全文
摘要:As with flex items, we can set an order value on grid items. Let’s see how this affects the DOM and the appearance of our grid.
阅读全文