Tutorial by Examples: aliases

There are two ways of creating aliases in Git: with the ~/.gitconfig file: [alias] ci = commit st = status co = checkout with the command line: git config --global alias.ci "commit" git config --global alias.st "status" git config --global alias....
You can list existing git aliases using --get-regexp: $ git config --get-regexp '^alias\.' Searching aliases To search aliases, add the following to your .gitconfig under [alias]: aliases = !git config --list | grep ^alias\\. | cut -c 7- | grep -Ei --color \"$1\" "#" The...
alias -p will list all the current aliases.
Column aliases are used mainly to shorten code and make column names more readable. Code becomes shorter as long table names and unnecessary identification of columns (e.g., there may be 2 IDs in the table, but only one is used in the statement) can be avoided. Along with table aliases this allows ...
Sometimes you may encounter members that have really long member names, such as thisIsWayTooLongOfAName(). In this case, you can import the member and give it a shorter name to use in your current module: import {thisIsWayTooLongOfAName as shortName} from 'module' shortName() You can import m...
Git lets you use non-git commands and full sh shell syntax in your aliases if you prefix them with !. In your ~/.gitconfig file: [alias] temp = !git add -A && git commit -m "Temp" The fact that full shell syntax is available in these prefixed aliases also means you can us...
In PowerShell, there are many ways to achieve the same result. This can be illustrated nicely with the simple & familiar Hello World example: Using Write-Host: Write-Host "Hello World" Using Write-Output: Write-Output 'Hello world' It's worth noting that although Write-Outp...
When contributors add to a project from different machines or operating systems, it may happen that they use different email addresses or names for this, which will fragment contributor lists and statistics. Running git shortlog -sn to get a list of contributors and the number of commits by them co...
If you put your commonly used aliases into an .iex.exs file at the root of your app, IEx will load them for you on startup. alias App.{User, Repo}
Sometimes we want to give a type a more descriptive name. Let's say our app has a data type representing users: { name : String, age : Int, email : String } And our functions on users have type signatures along the lines of: prettyPrintUser : { name : String, age : Int, email : String } -> S...
A class or struct can also define member type aliases, which are type aliases contained within, and treated as members of, the class itself. struct IHaveATypedef { typedef int MyTypedef; }; struct IHaveATemplateTypedef { template<typename T> using MyTemplateTypedef = std::v...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
FOR JSON PATH enables you to control format of the output JSON using column aliases: SELECT top 3 object_id as id, name as [data.name], type as [data.type] FROM sys.objects FOR JSON PATH Column alias will be used as a key name. Dot-separated column aliases (data.name and data.type) will be gen...
To alias a command in you ~/.zshrc file, you can use the following syntax: alias [alias-name]="[command-to-execute]" For example, it is common to execute the command ls -a. You can alias this command as la as such: alias la="ls -a" After reloading the ~/.zshrc file, you w...
type Meter = Double This simple approach has serious drawbacks for unit handling as every other type that is a Double will be compatible with it: type Second = Double var length: Meter = 3 val duration: Second = 1 length = duration length = 0d All of the above compiles, so in this case un...
Aliases are named shortcuts of commands, one can define and use in interactive bash instances. They are held in an associative array named BASH_ALIASES. To use this var in a script, it must be run within an interactive shell #!/bin/bash -li # note the -li above! -l makes this behave like a login s...
Global aliases In bash, aliases can only be placed at the beginning of of a command, but zsh supports aliases anywhere. If you place the following line in your $ZDOTDIR/.zshrc alias -g G=' | grep -i' You can then run cat haystack.txt G "needle" Suffix aliases (Added in zsh 4.2.x) ...
Elixir allows you to add aliases for your mix commands. Cool thing if you want to save yourself some typing. Open mix.exs in your Elixir project. First, add aliases/0 function to the keyword list that the project function returns. Adding () at the end of the aliases function will prevent compiler...

Page 1 of 1