Skip to content

Instantly share code, notes, and snippets.

@nutrino
nutrino / git-sparse-clone.sh
Created May 4, 2022 23:06 — forked from AndrianBdn/git-sparse-clone.sh
git-sparse-clone.sh
#!/bin/sh
#
# This script can clone/checkout a single folder from git repository
# - Might be used for checking out micro-services from monolithic git repository
#
# - You can even do checkout into home directory, for example
# git-sparse-clone.sh [email protected]:readdle/fluix-web.git /home/login login
#
# This will cause the shell to exit immediately if a simple command exits with a nonzero exit value.
@nutrino
nutrino / conda_environment_rename.sh
Created November 13, 2020 08:48 — forked from Mukei/conda_environment_rename.sh
How to rename a conda environment (workaround)
#One workaround is to create clone environment, and then remove original one:
#(remember about deactivating current environment with deactivate on Windows and source deactivate on macOS/Linux)
conda create --name new_name --clone old_name --offline #use --offline flag to disable the redownload of all your packages
conda remove --name old_name --all # or its alias: `conda env remove --name old_name`
#There are several drawbacks of this method:
# time consumed on copying environment's files,
# temporary double disk usage.
@nutrino
nutrino / titleUrlMarkdownClip.js
Created January 6, 2020 06:29 — forked from bradleybossard/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@nutrino
nutrino / url_Medium_remove_location_hash_Greasemonkey.user.js
Last active November 21, 2016 12:53 — forked from iki/Medium: remove location hash.user.js
url: Medium remove location hash Greasemonkey
// ==UserScript==
// @name url: Medium remove location hash Greasemonkey
// @namespace http://efcl.info/
// @description Remove location hash from medium
// @include *#.*
// @version 1
// @grant none
// ==/UserScript==
// TamperMonkey does not work well with hash '#' in @include urls:
@nutrino
nutrino / utmstrip.user.js
Created July 29, 2016 17:33 — forked from paulirish/utmstrip.user.js
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.2
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http*://*?*
// @grant none
// ==/UserScript==
@nutrino
nutrino / 0_reuse_code.js
Created October 15, 2015 03:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console