Skip to content

Instantly share code, notes, and snippets.

View foxoman's full-sized avatar

Sultan Al Isaiee foxoman

View GitHub Profile
@foxoman
foxoman / RPS_ASCII_Art.py
Created November 29, 2021 20:28 — forked from wynand1004/RPS_ASCII_Art.py
Rock, Paper, Scissors ASCII Art
# Rock Paper Scissors ASCII Art
# Rock
print("""
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
@foxoman
foxoman / cmake_windows_icon.txt
Last active October 31, 2021 18:49 — forked from Niakr1s/cmake_windows_icon.txt
How to add icon to cmake app in windows
1. Put app.ico in directory.
2. Create app.rc in same directory with one line:
IDI_ICON1 ICON DISCARDABLE "app.ico"
3. Run command (Warning: it's app.o, not app.res, how it is mentioned in other manuals!)
// in windows
windres app.rc -o app.o
// in linux
@foxoman
foxoman / Dockerfile
Created June 18, 2020 10:20 — forked from fgsahoward/Dockerfile
Qt WebAsm Arch Linux Dockerfile
FROM base/archlinux:latest AS base
RUN pacman -Sy --noconfirm binutils perl python libxcb clang emscripten git make cmake qbs
ENV PATH="/usr/lib/emscripten:${PATH}"
FROM base AS repos-configured
COPY ./configure-qt5-repos.sh ./
RUN ./configure-qt5-repos.sh
FROM repos-configured AS repos-built
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4
@foxoman
foxoman / main.cpp
Created June 21, 2018 10:42 — forked from ynonp/main.cpp
QProcess output example
#include <QCoreApplication>
#include <QtCore/QtCore>
#include "monitor.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QProcess p;
p.start("/bin/ls");
@foxoman
foxoman / example.qml
Created May 21, 2018 22:57 — forked from jdowner/example.qml
How to pass a Qml Component as a signal parameter.
import QtQuick 1.0
Rectangle {
height: 300
width: 400
color: "gray"
// This text element is for visual feedback when the signal fires
Text {
text: "(empty)"
@foxoman
foxoman / zombie-war.cpp
Created May 15, 2018 23:31 — forked from sagebind/zombie-war.cpp
A simple game in C++ for a class exercise.
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
using namespace std;
int createZombie() {
if (rand() % 67 < 10)
return 11;
@foxoman
foxoman / rand.cpp
Created May 5, 2018 07:13 — forked from fffaraz/rand.cpp
Random number in Qt
#include <QGlobal.h>
#include <QTime>
int QMyClass::randInt(int low, int high)
{
// Random number between low and high
return qrand() % ((high + 1) - low) + low;
}
// Create seed for the random
import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater
@foxoman
foxoman / .clang-format
Created April 8, 2018 19:11 — forked from idelsink/.clang-format
Clang format file.
# clang-format
# Made by: Ingmar Delsink
# idelsink.com
# See http://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Tested with: clang-format version 3.7.1
# General
#########
# The style used for all options not specifically set in the configuration.