This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick | |
Rectangle { | |
width: 320 | |
height: 320 | |
color: '#00FF00' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 :-). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
Rectangle { | |
width: 320 | |
height: 320 | |
color: '#00FF00' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 1.0 | |
Rectangle { | |
width: 360 | |
height: 360 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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(); |