This file contains 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
void setElidedText(QLabel* label, const QString &text){ | |
QFontMetrics metrix(label->font()); | |
int width = label->width() - 2; | |
QString clippedText = metrix.elidedText(text, Qt::ElideMiddle, width); | |
label->setText(clippedText); | |
} |
This file contains 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
#!/bin/bash | |
function stacktrace() { | |
frame=0 | |
while caller $frame ; do frame=$((frame + 1)) ; done | |
} | |
function lib_inner() { | |
stacktrace | |
} |
This file contains 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
$svcName = Get-Service -DisplayName *cruise* | select -Exp Name | |
$svcKey = Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\$svcName | |
# Set 9th bit, from http://www.codeproject.com/KB/install/cswindowsservicedesktop.aspx | |
$newType = $svcKey.GetValue('Type') -bor 0x100 | |
Set-ItemProperty $svcKey.PSPath -Name Type -Value $newType |