Tutorial by Examples: git

the steps in this example will use the following project structure as a demonstration and we intend to export it to the "GHTuts" Repository [Note that the Repo doesn't exist yet on github] but leave the "SensitiveProject" without publish as it contains some passwords, keys, et...
If you are unsure which rules to list in your .gitignore file, or you just want to add generally accepted exceptions to your project, you can choose or generate a .gitignore file: https://www.toptal.com/developers/gitignore https://github.com/github/gitignore Many hosting services such as Git...
If your team is following a rebase-based workflow, it may be a advantageous to setup git so that each newly created branch will perform a rebase operation, instead of a merge operation, during a git pull. To setup every new branch to automatically rebase, add the following to your .gitconfig or .gi...
type TIntegerList = class(TList<Integer>) public function Sum: Integer; end; ... function TIntegerList.Sum: Integer; var Item: Integer; begin Result := 0; for Item in Self do Result := Result + Item; end;
Check existing remote git remote -v # origin https://github.com/username/repo.git (fetch) # origin https://github.com/usernam/repo.git (push) Changing repository URL git remote set-url origin https://github.com/username/repo2.git # Change the 'origin' remote's URL Verify new remote URL ...
git log master..foo will show the commits that are on foo and not on master. Helpful for seeing what commits you've added since branching!
Sometimes you want to have a file held in Git but ignore subsequent changes. Tell Git to ignore changes to a file or directory using update-index: git update-index --assume-unchanged my-file.txt The above command instructs Git to assume my-file.txt hasn't been changed, and not to check or repor...
Create a new repository or clone an existing one. Create a new branch called gh-pages without any history $ git checkout --orphan gh-pages # ensure you are in the correct directory then, # remove all files from the old working tree $ git rm -rf Add an index.html file to the root of t...
Generally, if we want to remove an element from an array, we need to know it's index so that we can remove it easily using remove(at:) function. But what if we don't know the index but we know the value of element to be removed! So here is the simple extension to an array which will allow us to re...
Iterators produce enumerators. In C#, enumerators are produced by defining methods, properties or indexers that contain yield statements. Most methods will return control to their caller through normal return statements, which disposes all state local to that method. In contrast, methods that use y...
This example goes over how to set up CoreNLP from the GitHub repo. The GitHub code has newer features than the official release, but may be unstable. This example will take you through downloading, building, and running a simple command-line invocation of CoreNLP. Prerequisites: Java 8 or newer....
USE AdventureWorks2012; GO CREATE FULLTEXT INDEX ON Production.Document ( Title Language 1033, DocumentSummary Language 1033, Document TYPE COLUMN FileExtension Language 1033 ) KEY INDEX PK_Document_DocumentID ...
Sometimes it happens that a file was being tracked by git, but in a later point in time was added to .gitignore, in order to stop tracking it. It's a very common scenario to forget to clean up such files before its addition to .gitignore. In this case, the old file will still be hanging around in th...
The built-in werkzeug server certainly is not suitable for running production servers. The most obvious reason is the fact that the werkzeug server is single-threaded and thus can only handle one request at a time. Because of this we want to use the uWSGI Server to serve our application instead. In...
Now we want to install nginx to serve our application. sudo apt-get install nginx # on debian/ubuntu Then we create a configuration for our website cd /etc/nginx/site-available # go to the configuration for available sites # create a file flaskconfig with your favourite editor flaskconfig...
textBox.KeyPress += (sender, e) => e.Handled = !char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar); This will only permit the use of digits and control characters in the TextBox, other combinations are possible using the same approach of setting the Handle property to true to block ...
For signing to work you need a default GPG key configured. You can turn it on or off as follows: npm config set sign-git-tag <true or false>
Background: if you work on a project like the Linux kernel, rather than make a pull request you will need to submit your commits to a listserv for review. This entry details how to use git-send email with Gmail. Add the following to your .gitconfig file: [sendemail] smtpserver = smtp.googlema...
This trick helps you select an element using the ID as a value for an attribute selector to avoid the high specificity of the ID selector. HTML: <div id="element">...</div> CSS #element { ... } /* High specificity will override many selectors */ [id="element&quo...
Assume you want to delegate to a class but you do not want to provide the delegated-to class in the constructor parameter. Instead, you want to construct it privately, making the constructor caller unaware of it. At first this might seem impossible because class delegation allows to delegate only to...

Page 4 of 8