start new:
tmux
start new with session name:
tmux new -s myname
| // Usage: | |
| // val dircache = new CachedMkdir | |
| // dircache.mkdirp("a/b/c/d/e") // creates the directory structure | |
| // dircache.mkdirp("a/b/c/d/e") // does nothing | |
| // dircache.mkdirp("a/b/Z/Y/Z") // only creates from b/ down | |
| class CachedMkdir { | |
| var cache = Set[String]() |
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |
| # Enable syntax-highlighting in less. | |
| # Last tested on CentOS 6.3. | |
| # | |
| # First, add these two lines to ~/.bashrc | |
| # export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" | |
| # export LESS=" -R " | |
| sudo yum -y install boost boost-devel ctags | |
| wget http://springdale.math.ias.edu/data/puias/unsupported/6/x86_64/source-highlight-3.1.6-3.puias6.x86_64.rpm |
| #!/bin/bash | |
| # | |
| # Set up OSX preferences | |
| # | |
| # Inspired by: https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| ########################################### | |
| # CONFIG | |
| HOSTNAME="machiavellia" | |
| TIMEZONE="America/Chicago" # 'systemsetup -listtimezones' |
| realm=Sonatype Nexus Repository Manager | |
| host=nexus.company.com | |
| user=admin | |
| password=admin123 |
| ! Title: Hide LinkedIn Ads | |
| ! Last modified: 19 Sep 2019 | |
| ! Expires: 20 days (update frequency) | |
| ! Homepage: https://gist.github.com/jhult/802e89c64c4b6f27a3a9 | |
| ! Source: https://gist.githubusercontent.com/jhult/802e89c64c4b6f27a3a9/raw/hide_linkedin_ads.txt | |
| ! Licence: https://opensource.org/licenses/MIT | |
| ! Ad Banner | |
| linkedin.com##.ad-banner-container |
| namespace Analogy | |
| { | |
| /// <summary> | |
| /// This example shows that a library that needs access to target .NET Standard 1.3 | |
| /// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
| /// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
| /// </summary>INetCoreApp10 | |
| class Example1 | |
| { | |
| public void Net45Application(INetFramework45 platform) |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32: