Skip to content

Instantly share code, notes, and snippets.

1765
apa420
arzenhuz
baxx
bendover_xd
bottleshark
buletbroof
chancu
commname
conf_xd
{
"banned": true,
"input_message": "🍑",
"banphrase_data": {
"permanent": false,
"length": 300,
"name": "1",
"phrase": "🍑"
}
}
@pajlada
pajlada / asd.cpp
Last active January 15, 2018 14:55
auto& db = DatabaseHandle::get();
{
hemirt::DB::Query<hemirt::DB::MariaDB::Values> q("SHOW TABLES LIKE \'wnmabot_settings\'");
q.type = hemirt::DB::QueryType::RAWSQL;
auto res = db.executeQuery(std::move(q));
if (auto eval = res.error(); eval) {
std::cerr << "Showing table `wnmabot_settings` error: " << eval->error() << std::endl;
this->err = true;
src/application.hpp:3: 'singletons/ircmanager.hpp' does not need to be #included
src/application.hpp:4: 'singletons/resourcemanager.hpp' does not need to be #included
src/channel.hpp:3: 'logging/loggingchannel.hpp' does not need to be #included
src/channel.hpp:4: 'messages/image.hpp' does not need to be #included
src/channel.hpp:6: 'util/concurrentmap.hpp' does not need to be #included
src/channeldata.hpp:4: 'messages/image.hpp' does not need to be #included
src/emojis.hpp:3: 'messages/image.hpp' does not need to be #included
src/emojis.hpp:4: 'util/concurrentmap.hpp' does not need to be #included
src/logging/loggingchannel.hpp:3: 'messages/message.hpp' does not need to be #included; use a forward declaration instead
src/logging/loggingmanager.cpp:11: static data 'logBasePath'

Document Style Guidelines

Get it automated with QT Creator + Beautifier + Clang Format

  1. Download LLVM: http://releases.llvm.org/5.0.1/LLVM-5.0.1-win64.exe
  2. During the installation, make sure to add it to your path
  3. In QT Creator, select Help > About Plugins > C++ > Beautifier to enable the plugin
  4. Restart QT Creator
  5. Select Tools > Options > Beautifier
  6. Create a custom style called Chatterino, and copy paste the contents of .clang-format into it (I don't think the file can be automatically detected by QT Creator yet)
  7. Add a hotkey for the "Clang format file". I use F1
. 0 Id: 3e7c.216c Suspend: 1 Teb: 00000032`a8157000 Unfrozen
Child-SP RetAddr Call Site
00000032`a82f7fb0 00000000`5d65d028 chatterino!chatterino::widgets::Scrollbar::paintEvent(class QPaintEvent * __formal = 0x00000032`a82f8e78)+0x1c7 [c:\dev\git\chatterino2\src\widgets\scrollbar.cpp @ 224]
00000032`a82f8070 00000000`5d5fb8ae Qt5Widgetsd!QWidget::event(class QEvent * event = 0x00000032`a82f8e78)+0x9a8 [c:\users\qt\work\qt\qtbase\src\widgets\kernel\qwidget.cpp @ 8954]
00000032`a82f8370 00000000`5d5f8f66 Qt5Widgetsd!QApplicationPrivate::notify_helper(class QObject * receiver = 0x000001e5`4453e5f0, class QEvent * e = 0x00000032`a82f8e78)+0x17e [c:\users\qt\work\qt\qtbase\src\widgets\kernel\qapplication.cpp @ 3717]
00000032`a82f83d0 00000000`5caa87f6 Qt5Widgetsd!QApplication::notify(class QObject * receiver = 0x000001e5`4453e5f0, class QEvent * e = 0x00000032`a82f8e78)+0x3166 [c:\users\qt\work\qt\qtbase\src\widgets\kernel\qapplication.cpp @ 3680]
00000032`a82f8da0 00000000`5cc0ea4b Qt5Cored!

HEJ

@pajlada
pajlada / test.sql
Last active November 20, 2017 17:17
# Move stats from new user to old user
UPDATE
tb_user OldUser,
(
SELECT
level,
points,
minutes_in_chat_online,
minutes_in_chat_offline
FROM tb_user
void main()
{
/// Old way
NetworkManager::urlFetch(QUrl("google.com"), [](auto reply) {
// do shit with reply
});
// or
NetworkManager::urlFetch(QNetworkRequest("google.com"), [](auto reply) {
@pajlada
pajlada / .gitconfig
Created October 25, 2017 14:26
2017-10-25 .gitconfig
[alias]
st = status
ci = commit --verbose
co = checkout
df = diff
lg = log -p
ap = add --patch
permission-reset = !git diff -p -R --no-color | grep -E \"^(diff|(old|new) mode)\" --color=never | git apply