Skip to content

Instantly share code, notes, and snippets.

View skyrpex's full-sized avatar
👋

Cristian Pallarés skyrpex

👋
View GitHub Profile
@skyrpex
skyrpex / qt5-fusion-dark.cpp
Last active October 5, 2022 10:57
Qt5 Fusion style (dark color palette)
qApp->setStyle(QStyleFactory::create("fusion"));
QPalette palette;
palette.setColor(QPalette::Window, QColor(53,53,53));
palette.setColor(QPalette::WindowText, Qt::white);
palette.setColor(QPalette::Base, QColor(15,15,15));
palette.setColor(QPalette::AlternateBase, QColor(53,53,53));
palette.setColor(QPalette::ToolTipBase, Qt::white);
palette.setColor(QPalette::ToolTipText, Qt::white);
palette.setColor(QPalette::Text, Qt::white);
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
before_install:
- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev
script:
- qmake -qt=qt5 -v
- qmake -qt=qt5
- make
#!/bin/sh
xinput --set-prop "pointer:Razer Razer Lachesis" "Device Accel Constant Deceleration" 5
xinput --set-prop "pointer:Razer Razer Lachesis" "Device Accel Velocity Scaling" 1
After installing Qt5 x64 linux, I couldn't start any related Qt program by the console (ie, qmake). The error was the following:
qmake: could not find a Qt installation of ''
To solve it, just create ~/.config/qtchooser/default.conf with the following two lines (pointing to your Qt installation):
/opt/Qt/5.1.1/gcc_64/bin
/opt/Qt/5.1.1/gcc_64/lib
#pragma once
#include <memory>
namespace stx
{
namespace
{
template <class T>
bool operator==(const std::unique_ptr<T> &a, const T *b)
@skyrpex
skyrpex / Key Bindings
Created February 20, 2014 10:01
Sublime Text 3 configuration
[
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
]
var runner = require('child_process');
runner.exec(
'php -r \'include("settings.php"); print json_encode($databases);\'',
function (err, stdout, stderr) {
var connection = JSON.parse(stdout).default.default;
console.log(connection.database);
// result botdb
}
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);
@skyrpex
skyrpex / preventDefault.babel.js
Last active October 6, 2015 09:51
Vue Directives: Prevent Default
const eventNames = {
BUTTON: 'click',
A: 'click',
FORM: 'submit',
};
export default {
bind() {
const eventName = eventNames[this.el.nodeName];
if (!eventName) {