Skip to content

Instantly share code, notes, and snippets.

View jryannel's full-sized avatar

Jürgen Ryannel jryannel

View GitHub Profile
@jryannel
jryannel / execgit.go
Last active June 22, 2022 11:31
Executes git command
// ExecGit executes a git command.
func ExecGit(args ...string) error {
log.Debugf("exec git %s", args)
_, err := exec.LookPath("git")
if err != nil {
log.Warnf("git not found")
return err
}
err = exec.Command("git", args...).Run()
if err != nil {
@jryannel
jryannel / check.go
Created June 22, 2022 11:30
check if string is url or local dir
func IsUrl(path string) bool {
u, err := url.Parse(path)
return err == nil && u.Scheme != "" && u.Host != ""
}
func IsDir(path string) bool {
s, err := os.Stat(path)
return s.IsDir() && os.IsExist(err)
}
@jryannel
jryannel / main.qml
Created July 17, 2021 15:27
Example QML document loaded via network request
import QtQuick
Rectangle {
width: 320
height: 320
color: '#00FF00'
}
# Contributing
:+1::tada: First, thanks for taking the time to contribute! :tada::+1:
The following is a set of guidelines to contribute to the QmlBook, which is hosted at (https://github.com/qmlbook/qmlbook/) on GitHub.
## Licensing
You provide us the contributions under the [Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/) license for text and the [BSD](http://opensource.org/licenses/BSD-3-Clause) license for code. We keep the rights to print a book based on the provided content. We can not ensure that everyone will be correctly named, but we will do our best. This is just so that you understand what you are about todo :-).
@jryannel
jryannel / 0_reuse_code.js
Created February 1, 2016 06:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jryannel
jryannel / main.qml
Last active December 31, 2015 11:59
remote main.qml
import QtQuick 2.0
Rectangle {
width: 320
height: 320
color: '#00FF00'
}
@jryannel
jryannel / gist:917822
Created April 13, 2011 16:00
qml rectangle
import QtQuick 1.0
Rectangle {
width: 360
height: 360
}
@jryannel
jryannel / gist:917603
Created April 13, 2011 14:03
qt example 1
#include <QtGui/QApplication>
#include "view.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
View viewer;
viewer.setSource(QUrl("qml/main.qml"));
viewer.show();