Skip to content

Instantly share code, notes, and snippets.

View j-ulrich's full-sized avatar

Jochen Ulrich j-ulrich

View GitHub Profile
@andrey-str
andrey-str / setElidedText.cpp
Last active July 9, 2021 05:00
Set "Elided....Text" to QLabel
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);
}
@bluegraybox
bluegraybox / lib.sh
Created March 9, 2012 14:52
Stack traces in bash
#!/bin/bash
function stacktrace() {
frame=0
while caller $frame ; do frame=$((frame + 1)) ; done
}
function lib_inner() {
stacktrace
}
@dahlbyk
dahlbyk / Enable-AllowInteractWithDesktop
Created August 13, 2011 16:16
Set "Allow Interact with Desktop" for Windows Service
$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