Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
peteristhegreat / fix_db_to_allow_attach.bash
Created May 5, 2017 15:01
sqlite3 cannot attach database, caused by sql formatting issues...
sqldiff broken.db some_other.db
# output: sqldiff: cannot attach database "some_other.db"
# Use .dump to "clean" and resave the database
sqlite3 broken.db .dump | sqlite3 fixed.db
# Note that the fixed.db will likely be smaller than the original
sqldiff fixed.db some_other.db
# output: standard output
@peteristhegreat
peteristhegreat / AutoHotKey.ahk
Created July 3, 2017 14:32
AHK fine grained control of master volume
#InstallMouseHook
#Persistent
#SingleInstance Force
#NoEnv
SetTitleMatchMode, 2
detecthiddenwindows on
Vol = 5
^SPACE:: Winset, Alwaysontop, , A
@peteristhegreat
peteristhegreat / grouped.txt
Created July 17, 2017 02:34
Colossal Cave Adventure Vocabulary, List of Commands
carry
drop
say
unlock
light
extinguish
wave
attack
pour
eat
@peteristhegreat
peteristhegreat / freedesktop.org_icons_with_descriptions.txt
Last active March 25, 2025 01:04
QIcon::fromTheme, List of icons in gnome theme, in qt standardPixmaps and list on freedesktop.org
# https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html, aggregate list from each section
address-book-new The icon used for the action to create a new address book.
application-exit The icon used for exiting an application. Typically this is seen in the application's menus as File->Quit.
appointment-new The icon used for the action to create a new appointment in a calendaring application.
call-start The icon used for initiating or accepting a call. Should be similar to the standard cellular call pickup icon, a green handset with ear and mouth pieces facing upward.
call-stop The icon used for stopping a current call. Should be similar to the standard cellular call hangup icon, a red handset with ear and mouth pieces facing downward.
contact-new The icon used for the action to create a new contact in an address book application.
document-new The icon used for the action to create a new document.
document-open The icon used for the action to open a document.
document-open-recent T
@peteristhegreat
peteristhegreat / testsuite.cpp
Created August 18, 2017 15:36
QTest QComboBox QListView click on each item in a combobox
// Very helpful link: https://vicrucann.github.io/tutorials/qttest-signals-qtreewidget/
// Select an item in the combobox list
QComboBox * cb = m_widget->findChild<QComboBox*>("testStandComboBox");
QTest::mouseClick(cb, Qt::LeftButton);
QTest::qWait(1000);
QListView * lw = cb->findChild<QListView *>();
if(lw)
{
@peteristhegreat
peteristhegreat / test.cpp
Created August 18, 2017 16:15
QObject dumpObjectTree alternative
// m_widget->dumpObjectInfo();
// m_widget->dumpObjectTree();
QList <QWidget *> objDmp = m_widget->findChildren<QWidget *>();
foreach (QWidget * w, objDmp)
{
qDebug() << w->objectName() << w->metaObject()->className();//w->staticMetaObject.className();
}
// List all the form elements that the user might be interacting with
QList <QPushButton *> buttons = m_widget->findChildren<QPushButton*>();
@peteristhegreat
peteristhegreat / .vimrc
Created August 23, 2017 19:50
Another vimrc file
execute pathogen#infect()
set nocp
filetype plugin on
" configure tags - add additional tags here or comment out not-used ones
set tags+=~/.vim/tags/cpp
" set tags+=~/.vim/tags/gl
" set tags+=~/.vim/tags/sdl
set tags+=~/.vim/tags/qt4
set tags+=~/.vim/tags/sys_time
@peteristhegreat
peteristhegreat / .bashrc
Created August 23, 2017 20:11
Another .bashrc
#PS4='+ $(date "+%s.%N")\011 '
#exec 3>&2 2>/tmp/bashstart.$$.log
#set -x
# User specific aliases and functions
case "$HOST" in
myhost[123479]|theirhost[34])
@peteristhegreat
peteristhegreat / .gitconfig
Created August 23, 2017 20:13
Another .gitconfig
[user]
name = First Last
email = [email protected]
[diff]
tool = vimdiff
[color]
ui = auto
[diff "sqlite3"]
textconv = sqlite3 $1 .dump
[diff "db"]
@peteristhegreat
peteristhegreat / .vim
Created August 23, 2017 20:17
Another vim dir structure
.
|-- after
| |-- ftplugin
| | |-- c.vim
| | `-- cpp.vim
| `-- syntax
| |-- atk.vim
| |-- atspi.vim
| |-- c.vim
| |-- cairo.vim