Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

tagplus5 tagplus5

🎯
Focusing
View GitHub Profile
@fluxrad
fluxrad / onedark.theme
Last active Oct 24, 2021
A one-dark theme for xfce4-terminal
View onedark.theme
[Scheme]
Name=One Dark
ColorForeground=#ABB2BF
ColorCursor=#ABB2BF
ColorBackground=#282C34
ColorSelection=#3B4451
ColorSelectionUseDefault=FALSE
ColorBold=#B9C0CB
ColorBoldUseDefault=FALSE
ColorPalette=#282C34;#E06C75;#98C379;#E5C07B;#61AFEF;#C678DD;#56B6C2;#ABB2BF;#3E4452;#BE5046;#98C379;#D19A66;#61AFEF;#C678DD;#56B6C2;#5C6370
@grigory-v
grigory-v / backup-host.sh
Last active Nov 21, 2019
Backup with duplicity to yandex.disk
View backup-host.sh
#!/bin/sh
# Duplicity wrapper
#
# Not working for now. Yandex prevents uploading lagre files via webdav.
# add to crontab:
# 0 0 * * * /bin/sh /usr/local/sbin/backup-host.sh
set -e
@erickoledadevrel
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
anildigital / gist:862675ec1b7bccabc311
Created Jul 26, 2014
Remove dangling docker images
View gist:862675ec1b7bccabc311
docker rmi $(docker images -q -f dangling=true)
@simonlk
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:
http://docs.woothemes.com/document/editing-product-data-tabs/
http://www.sean-barton.co.uk/2013/03/remove-woocommerce-20-reviews-tab/#.UYnWe7XfB6N
http://www.sean-barton.co.uk/2013/03/sb-add-woocommerce-tabs-wordpress-plugin/#.UYrYL7XfB6M
@rantav
rantav / README.md
Created Jun 27, 2012
MongoDB increment or insert
View README.md

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:

tmux

start new with session name: