Tutorial by Examples: alias

using st = System.Text; //allows you to access classes within this namespace such as StringBuilder //prefixing them with only the defined alias and not the full namespace. i.e: //... var sb = new st.StringBuilder(); //instead of var sb = new System.Text.StringBuilder();
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 word='command' Invoking word will run command. Any arguments supplied to the alias are simply appended to the target of the alias: alias myAlias='some command --with --options' myAlias foo bar baz The shell will then execute: some command --with --options foo bar baz To include mul...
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...
The notation 'thing is equal to (quote thing). The reader will do the expansion: > (read-from-string "'a") (QUOTE A) Quoting is used to prevent further evaluation. The quoted object evaluates to itself. > 'a A > (eval '+ 1 2) 3
Assuming that bar is an alias for someCommand -flag1. Type bar on the command line and then press Ctrl+alt+e you'll get someCommand -flag1 where bar was standing.
To remove an existing alias, use: unalias {alias_name} Example: # create an alias $ alias now='date' # preview the alias $ now Thu Jul 21 17:11:25 CEST 2016 # remove the alias $ unalias now # test if removed $ now -bash: now: command not found
Sometimes you may want to bypass an alias temporarily, without disabling it. To work with a concrete example, consider this alias: alias ls='ls --color=auto' And let's say you want to use the ls command without disabling the alias. You have several options: Use the command builtin: command...
SELECT e.Fname, e.LName FROM Employees e The Employees table is given the alias 'e' directly after the table name. This helps remove ambiguity in scenarios where multiple tables have the same field name and you need to be specific as to which table you want to return data from. SELECT e.Fname,...
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}
Due to logical query processing order, alias can be used in order by. SELECT DisplayName, JoinDate as jd, Reputation as rep FROM Users ORDER BY jd, rep And can use relative order of the columns in the select statement .Consider the same example as above and instead of using alias use the relat...
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...
Unnamed class types may also be used when creating type aliases, i.e. via typedef and using: C++11 using vec2d = struct { float x; float y; }; typedef struct { float x; float y; } vec2d; vec2d pt; pt.x = 4.f; pt.y = 3.f;
Occasionally you may want to use the same tuple type in multiple places throughout your code. This can quickly get messy, especially if your tuple is complex: // Define a circle tuple by its center point and radius let unitCircle: (center: (x: CGFloat, y: CGFloat), radius: CGFloat) = ((0.0, 0.0), ...

Page 1 of 3