Skip to content

Instantly share code, notes, and snippets.

View palucki's full-sized avatar

Piotr Pałucki palucki

View GitHub Profile
@komasaru
komasaru / Mysql.cpp
Created August 17, 2014 05:54
C++ source code to connect to MariaDB(MySQL).
/*
* Example to connect to MariaDB(MySQL)
*/
#include <iostream>
#include <mysql/mysql.h> // require libmysqlclient-dev
#include <string>
using namespace std;
/*
@iikuy
iikuy / gist:8115191
Last active March 18, 2024 19:55
producer-consumer in C++11
#include <thread>
#include <iostream>
#include <queue>
std::mutex mx;
std::condition_variable cv;
std::queue<int> q;
bool finished = false;
@QuantumCD
QuantumCD / Qt 5 Dark Fusion Palette
Created August 15, 2013 21:40
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
@jasonbaldridge
jasonbaldridge / music.json
Created May 12, 2012 20:02
Simple JSON example with some musicians, albums, and songs
[{"name":"Radiohead","albums":[{"title":"The King of Limbs","songs":[{"title":"Bloom","length":"5:15"},{"title":"Morning Mr Magpie","length":"4:41"},{"title":"Little by Little","length":"4:27"},{"title":"Feral","length":"3:13"},{"title":"Lotus Flower","length":"5:01"},{"title":"Codex","length":"4:47"},{"title":"Give Up the Ghost","length":"4:50"},{"title":"Separator","length":"5:20"}],"description":"\n\tThe King of Limbs is the eighth studio album by English rock band Radiohead, produced by Nigel Godrich. It was self-released on 18 February 2011 as a download in MP3 and WAV formats, followed by physical CD and 12\" vinyl releases on 28 March, a wider digital release via AWAL, and a special \"newspaper\" edition on 9 May 2011. The physical editions were released through the band's Ticker Tape imprint on XL in the United Kingdom, TBD in the United States, and Hostess Entertainment in Japan.\n "},{"title":"OK Computer","songs":[{"title":"Airbag","length":"4:44"},{"title":"Paranoid Android","length":"6:23"},