As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
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)
// 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 |
# Last updated May, 2024 for Apple silicon Macs | |
# Install Homebrew if you don't already have it: https://brew.sh | |
# install nano from homebrew | |
brew install nano nanorc | |
# update your nanorc file | |
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc | |
# close and re-open your terminal and you'll have syntax highlighting |
docker rmi $(docker images -q -f dangling=true) |
/** | |
* 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(); |
#!/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 |
Function | Shortcut |
---|---|
New Tab | β + T |
Close Tab or Window | β + W (same as many mac apps) |
Go to Tab | β + Number Key (ie: β2 is 2nd tab) |
Go to Split Pane by Direction | β + Option + Arrow Key |
Cycle iTerm Windows | β + backtick (true of all mac apps and works with desktops/mission control) |
[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 |