Skip to content

Instantly share code, notes, and snippets.


tagplus5 tagplus5

View GitHub Profile
fluxrad / onedark.theme
Last active Dec 11, 2021
A one-dark theme for xfce4-terminal
View onedark.theme
Name=One Dark
grigory-v /
Last active Nov 21, 2019
Backup with duplicity to yandex.disk
# Duplicity wrapper
# Not working for now. Yandex prevents uploading lagre files via webdav.
# add to crontab:
# 0 0 * * * /bin/sh /usr/local/sbin/
set -e
erickoledadevrel / xmlToJson.js
Created Dec 1, 2014
A function to convert an XML string to a JSON object in Apps Script, using logic similar to the sunset method Xml.parse().
View xmlToJson.js
* Converts an XML string to a JSON object, using logic similar to the
* sunset method Xml.parse().
* @param {string} xml The XML to parse.
* @returns {Object} The parsed XML.
function xmlToJson(xml) {
var doc = XmlService.parse(xml);
var result = {};
var root = doc.getRootElement();
anildigital / gist:862675ec1b7bccabc311
Created Jul 26, 2014
Remove dangling docker images
View gist:862675ec1b7bccabc311
docker rmi $(docker images -q -f dangling=true)
BlakeGardner / install
Last active Jan 12, 2022
Syntax highlighting in nano on Mac OS
View install
# install Homebrew if you don't already have it:
# install nano from homebrew
brew install nano
# update your nanorc file
echo 'include "/opt/homebrew/Cellar/nano/NANO_VERSION_NUMBER/share/nano/*.nanorc"'>> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
simonlk / Woocommerce - output product variations in tab
Last active Apr 16, 2019
Output Woocommerce product variations as a table within a tab on the single product page
View Woocommerce - output product variations in tab
// Add to functions.php
Created by sk from Renegade Empire with help
from these sources:
rantav /
Created Jun 27, 2012
MongoDB increment or insert

In mongodb it's easy to make at upsert, meaning update-or-insert by calling

db.collection.update({criteria}, {updated fields}, true)

The third parameter means - insert a new document if the document doesn't exist yet. So, for example, the following will insert a new document for the user if there's no document for that user yet, and will update it if it already exists:

 db.users.update({user_id: '1234'}, {user_id: '1234', name: 'Ran'}, true)
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name: