Skip to content

Instantly share code, notes, and snippets.

View Wohlstand's full-sized avatar
🦊

Vitaly Novichkov Wohlstand

🦊
View GitHub Profile
#include "../lvlscene.h"
#include <QObject>
#include <QGraphicsSceneMouseEvent>
#include <QKeyEvent>
class EditMode : public QObject
{
Q_OBJECT
public:
explicit EditMode(LvlScene *ParentScene = 0, QObject *parent = 0);
@Wohlstand
Wohlstand / gist:ccdb82dc8a2d941dec08
Last active August 29, 2015 14:17
Fixed code to MistaEpic (smbx.org)
-- Wrong
left = 3
player=Player()
function onLoop()
printText(tostring(left),30, 160)
function onKeyDown(keycode)
if(keycode==KEY_RUN) then
left = left - 1
end
@Wohlstand
Wohlstand / gist:9d8bda938e408fb4bc8b
Created April 18, 2015 06:35
Don't flood build directory with object files
android:{
ARCH=android_arm
} else {
!contains(QMAKE_TARGET.arch, x86_64) {
ARCH=x32
} else {
ARCH=x64
}
}
static: {
#include <stdio.h>
#include <alloc.h>
//Класс, это тоже структура, но с возможностью разграничивать права доступа к членам извне
class MyQueue
{
public: //Члены класса, которые НЕдоступны для внешних обращений, получишь ошибку компиляции!
struct q
{
int n;
@Wohlstand
Wohlstand / build.log
Created July 5, 2015 18:43
OSXCross Build.log
+++ uname -s
++ PLATFORM=Linux
+++ basename ./build.sh
++ SCRIPT=build.sh
++ [[ build.sh != *wrapper/build.sh ]]
+++ tools/get_cpu_count.sh
++ JOBS=4
++ '[' build.sh '!=' build.sh -a build.sh '!=' build_clang.sh -a build.sh '!=' mount_xcode_image.sh -a build.sh '!=' gen_sdk_package_darling_dmg.sh -a build.sh '!=' gen_sdk_package_p7zip.sh ']'
++ [[ Linux == *BSD ]]
++ MAKE=make
@Wohlstand
Wohlstand / build static qt.sh
Created July 5, 2015 18:48
Build static Qt
#Hot to build static Qt on Linux
#For Linux Mint
./configure -static -release -nomake examples -nomake tools -prefix ~/Qt/Qt-5.5_static -qt-xcb -qt-libpng -no-libjpeg -qt-zlib -qt-pcre -gtkstyle -opensource -confirm-license -gtkstyle -opengl -qt-freetype -c++11
make
make install
#For CentOS
./configure -static -release -nomake examples -nomake tools -no-compile-examples -prefix ~/Qt/Qt-5.5_static -qt-xcb -qt-xkbcommon -qt-libpng -qt-zlib -qt-pcre -gtkstyle -opensource -confirm-license -gtkstyle -opengl -qt-freetype -c++11
@Wohlstand
Wohlstand / kill_jasprer.sh
Created July 5, 2015 18:50
Don't build buggy jasper (jp2) from Qt sources
#!/bin/bash
QTP=qt-everywhere-opensource-src-5.5.0
sed -i 's/qtCompileTest(jasper)/#qtCompileTest(jasper)/g' $QTP'/qtimageformats/qtimageformats.pro'
sed -i 's/jp2 \\/#jp2 \\/g' $QTP'/qtimageformats/src/plugins/imageformats/imageformats.pro'
rm -f $QTP'/qtimageformats/src/3rdparty/jasper.pri'
rm -Rf $QTP'/qtimageformats/src/3rdparty/jasper'
read -n 1
@Wohlstand
Wohlstand / xxx.pro
Last active February 20, 2018 00:02
Example of multi-command QMAKE_POST_LINK
QT += core gui widgets
EXTRA_BINFILES_WIN = $${EXTRA_LIBFILES}
EXTRA_BINFILES_WIN ~= s,/,\\,g
DESTDIR_WIN = $${DESTDIR} #$$OUT_PWD
DESTDIR_WIN ~= s,/,\\,g
for(FILE,EXTRA_BINFILES_WIN) {
QMAKE_POST_LINK += $$quote(cmd /c copy /y $${FILE} $${DESTDIR_WIN}$$escape_expand(\n\t))
@Wohlstand
Wohlstand / UpdateAllMyRepos.sh
Last active August 17, 2016 06:50
Update all git repos in specified folder
#!/bin/bash
# ===============A full path to repos folder====================
REPOS_DIR=/home/wohlstand/_git_repos
# ==============================================================
UpdRepo()
{
cd "$1"
if [ -d .git ]
then
@Wohlstand
Wohlstand / play.sh
Last active August 12, 2016 10:33
A simple sequential playlist to change playing music every 3 minutes or by key-press (looking for making shuffle)
#!/bin/bash
MAXTIME=180
PLAYER=/your/path/here/pge_musplay
PLAYDIR=$PWD/*.mid
ord() {
LC_CTYPE=C printf '%d' "'$1"
}