Skip to content

Instantly share code, notes, and snippets.

@tobiasBora
tobiasBora / README
Last active January 9, 2024 18:31
Demo basic flake
A basic flake sharing the same nixpkgs everywhere (nix shell, nix profile etc).
You can try to build me and run me in a VM with:
```
$ nixos-rebuild build-vm --flake git+https://gist.github.com/1f19628dc6b12bcd4438164b24226c6c.git#daw --refresh
$ ./result/bin/run-nixos-vm
```
The user is `daw` and the password is `foo`.
@tobiasBora
tobiasBora / README.md
Last active November 18, 2022 01:28
Qt5: QML hello world with Cmake (+nix package manager)

Demonstration of QML with Qt5 + meson + nix

If you have nix installed compile and run with:

$ nix build
$ ./result/bin/demo 

Explaination: we load the .qml file with qrc:///main.qml: it uses for that the file qml.qrc (the name is not important) that lists the resource files. This 'qml.qrc file is then given to resources in meson.build in order to compile the resources and include them in the final binary.

Demonstration of QML with Qt5 + qmake + nix

If you have nix installed compile and run with:

$ nix build
$ ./result/bin/demo 

Explaination: we load the .qml file with qrc:///main.qml: it uses for that the file qml.qrc (the name is not important) that lists the resource files. This 'qml.qrc file is then given to RESOURCES in demo.pro in order to compile the resources and include them in the final binary.

@tobiasBora
tobiasBora / CMakeLists.txt
Last active January 19, 2023 16:02
Qt5: QML hello world with Cmake (+nix package manager)
cmake_minimum_required(VERSION 3.1.0)
project(demo VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
#!/usr/bin/env sh
# Test it
# docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -it debian /bin/bash
# apt update
# apt install git wget nano
# adduser me
# su me
# cd
# echo "" > dady.sh
@tobiasBora
tobiasBora / set_up_local_scribd_download.sh
Created January 29, 2018 13:52
Easy way to locally setup scribd download, firefox, selenium, geckodriver... and make sure that you don't have outdated version.
#!/usr/bin/env bash
set -e
function usage_end(){
echo "======================================"
echo "Great, you downloaded everything."
echo "Now (and later), just run the following to load the path:"
echo "$ bash set_up_local_scribd_download.sh"
echo "And then use the scribd downloader like this:"
echo "$ scribd_downloader_3.py <your url> <your output.pdf>"