Skip to content

Instantly share code, notes, and snippets.

setBackground() {
osascript -e "tell application \"iTerm\"
set myterm to (current terminal)
tell myterm
set mysession to (current session)
tell mysession
set background color to $1
end tell
end tell
end tell"
#!/bin/sh
DB=YOUR_DB_NAME
USER=DB_USER
PASSWORD=DB_PASS
BACKUP_DIR=~/db_backups/$DB
[ -d "$BACKUP_DIR" ] || mkdir -p "$BACKUP_DIR"
@nopium
nopium / gist:5316199
Created April 5, 2013 02:44
detect console open
function isCosoleOpen() {
console.profile();
console.profileEnd();
if(console.clear) { console.clear() };
return console.profiles.length > 0;
}