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);
@skyrpex
skyrpex / esm-package.md
Created April 20, 2022 11:56 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@skyrpex
skyrpex / salt-hash-password.js
Created March 30, 2022 15:56 — forked from branneman/salt-hash-password.js
Node.js: Create salted hashed password
const crypto = require('crypto')
const { promisify } = require('util')
const pbkdf2 = promisify(crypto.pbkdf2)
module.exports = { createHashPasswordFn, isPasswordCorrect }
/**
* @typedef {Object} HashPassword
* @property {String} hash
* @property {String} salt
boost::optional<int> f1(int a);
boost::optional<int> f2(int b, int c);
boost::optional<int> f3(int d);
boost::optional<int> f4(int e);
boost::optional<int> result = chain(
[] { return f1(3); },
[] { return f1(4); }
).then(
[] (int b, int c) { return f2(b, c); }
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" recordSetVar="macros" docType="html-5.0"
standardController="Macro__c" extensions="ApplyMacroControllerExtension" title="Select Macro" >
<apex:includeScript value=""/>
<apex:includeScript value="/support/console/30.0/integration.js"/>
<apex:includeScript value="/soap/ajax/30.0/connection.js"/>
<apex:includeScript value="/support/api/30.0/interaction.js"/>
<apex:includeScript value="/canvas/sdk/js/30.0/publisher.js"/>
<apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
@skyrpex
skyrpex / entityx_tx2.cc
Created May 17, 2016 10:25 — forked from alecthomas/entityx_tx2.cc
Parallel EntityX prototype
#include <utility>
#include <thread>
#include <limits>
#include <algorithm>
#include <cassert>
#include <vector>
#include <cstdint>
#include <iostream>
#include <mutex>
#include <future>
@skyrpex
skyrpex / .gitconfig
Created April 15, 2016 07:42 — forked from berngp/.gitconfig
dot.gitconfig
[user]
name = Your Name
email = your.name@mail.com
[color]
ui = true
[core]
excludesfile = ~/.gitignore_global
editor = /usr/local/bin/mvim -f
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
#!/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
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