|" Return project's root directory|
|" This function is used to return current projects root directory, as|
|" determined by GIT or SVN, without changing vim's cwd.|
|" @param string a:1 A comma seperated list of files or directories, the|
|" presence of which can be used to identify the root directory of a project.|
I've been maintaining my own version of Strip Trailing Spaces function (attached at the bottom of this post) since I first started using vim. It grew out of a simple
:%s/\s*$// and now includes a number of features:
- it preserves search history and the last search string
- it doesn't change editor's
- it doesn't add a new jumplist and changelist record
- it preserves editor's view and cursor position
However, over the years I've noticed that I never needed to undo the results of stripping trailing spaces from a file. In fact, I would go as far as to say that when undoing changes in a file, the function produces an understandable but somewhat undesirable cursor jump (to the top-most trailing space it strippes) which disrupts my work flow. So, I set about to exclude the results of this function from the undo history all together.
After reading [Restore the cursor position after undoing text change made by a script](http://vim.wikia.com/wiki/Restore_the_cursor_position_aft
|* MusicBrainz (http://musicbrainz.org) comes with a custom unaccent pgsql extension (musicbrainz_unaccent).|
|* However, AWS PGSQL service does not include this extension and it can not be easilly added.|
|* The following code duplicates musicbrainz_unaccent functionality using the built in unaccent extension.|
|CREATE EXTENSION unaccent;|
|CREATE OR REPLACE FUNCTION musicbrainz_unaccent(txt text) RETURNS text AS $$|
I find that every now and again VirtualBox glitches out and fails to install (or update) on macOS. This has happened to me a few times now, and every single time it's because Apple security policies prevent VirtualBox kernel extensions from being loaded.
Attempt 1 of 2: Start with OSXDaily fix: check your "System Preferences > Security & Privacy > General". There might be a discreet note in the lower part of the window saying that kernel extensions from the developer Oracle could not be loaded and an option to whitelist them by clicking on the "Allow" button. Done! :)
Please allow us to rename existing @icloud.com Apple IDs to a mail aliases defined on the same account (that's the additional email address defined via the Preferences pane of the Mail app on icloud.com).
An Apple account is identified by its Apple ID, which for a long standing account, has a lot of information associated with it. However, an account handle set up years ago can become irrelevant over time (people get married, change their names, etc).
We already can define Mail aliases for existing Apple IDs. These aliases are used with Mail, Messages and Facetime... but not when we share content via the share button/menu (ie: if you share a note or a reminder with someone the content will be shared using your Apple ID).
Currently, the only way to fix this is to create a brand new Apple ID, and then migrate all of your existing content to that Apple ID. However, this is not an acceptable solution to many people.
|# Remove Project Environment artefacts from a Github project: This script|
|# can be used to remove all "environment" artefacts from a project that,|
|# for example, no longer uses github-pages. Doing so would also remove the|
|# "environment" tab from the Github repository.|
|# The script requires for `curl` and `jq` to be in your PATH. You will also|
|# need to define a personal access token with `repo_deployment` scope on|
|# Github, and update the values of API_URL_BASE and ACCESS_TOKEN bellow.|
Caching multi-stage builds in GitHub Actions
Caching Docker builds in GitHub Actions is an excellent article by @dtinth which analyses various strategies for speeding up builds in GitHub Actions. The upshot of the article is a fairly decisive conclusion that the best two ways to improve build times are:
Build images via a standard
docker buildcommand, while using GitHub Packages' Docker registry as a cache = Longer initial build but fastest re-build times.
Build your images via docker integrated BuildKit (
DOCKER_BUILDKIT=1 docker build), while using a local registry and actions/cache to persist build caches = Fastest initial build but slightly longer re-build times.