Qin Yu, Apr 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from PySide.QtCore import QObject, Slot | |
| from PySide.QtGui import QApplication | |
| from PySide.QtWebKit import QWebView | |
| html = """ | |
| <html> | |
| <body> | |
| <h1>Hello!</h1><br> |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Usage: | |
| # source iterm2.zsh | |
| # iTerm2 tab color commands | |
| # https://iterm2.com/documentation-escape-codes.html | |
| if [[ -n "$ITERM_SESSION_ID" ]]; then | |
| tab-color() { | |
| echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
| echo -ne "\033]6;1;bg;green;brightness;$2\a" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## mysql::master | |
| ruby_block "store_mysql_master_status" do | |
| block do | |
| node.set[:mysql][:master] = true | |
| m = Mysql.new("localhost", "root", node[:mysql][:server_root_password]) | |
| m.query("show master status") do |row| | |
| row.each_hash do |h| | |
| node.set[:mysql][:master_file] = h['File'] | |
| node.set[:mysql][:master_position] = h['Position'] | |
| end |