This file contains hidden or 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
#============================================================================= | |
# dark_powered.toml --- dark powered configuration example for SpaceVim | |
# Copyright (c) 2016-2017 Wang Shidong & Contributors | |
# Author: Wang Shidong < wsdjeg at 163.com > | |
# URL: https://spacevim.org | |
# License: GPLv3 | |
#============================================================================= | |
# All SpaceVim option below [option] section | |
[options] |
This file contains hidden or 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
cargo build [16:54:54] | |
Compiling restapi v0.1.0 (file:restapi) | |
error[E0507]: cannot move out of captured variable in an `Fn` closure | |
--> src/main.rs:57:62 | |
| | |
55 | let path = String::from("/path/to/data.json"); | |
| ---- captured outer variable | |
56 | server::new(|| { | |
57 | App::with_state(AppState::new(AppState::collect_data(path).unwrap())) | |
| ^^^^ cannot move out of captured variable in an `Fn` closure |
This file contains hidden or 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
{ | |
var(func: anyofterms(title, "first")) { | |
ticket as _uid_ | |
} | |
tickets(func: uid(ticket)) { | |
title | |
desc | |
tag { | |
~can_do { |
This file contains hidden or 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
mutation { | |
schema { | |
name: string @index(exact, term) . | |
can_do: uid @reverse @count . | |
title: string @index(exact, term) . | |
desc: string . | |
tag: uid @reverse @count . | |
} | |
set { | |
_:javascript <name> "javascript" . |
This file contains hidden or 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
//main.go | |
... | |
type HTMLText struct { //Already created, just a point of reference | |
... | |
} | |
func (h *HTMLText) CopyToClip(txt string) { //A method of the HTMLText pointer that takes a raw markdown string | |
formatted := blackfriday.MarkdownCommon([]byte(txt)) //We've seen this before |
This file contains hidden or 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
//assets/main.qml | |
... | |
ApplicationWindow { | |
... | |
toolBar: ToolBar { //Create a toolbar and set it as the ApplicationWindow's toolBar | |
//This will create the space and auto adjust the other children of ApplicationWindow down | |
RowLayout { //This formats the toolbar to move the buttons side by side |
This file contains hidden or 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
//assets/main.qml | |
... | |
TextArea { | |
id: rtarea | |
... | |
onActiveFocusChange: { //Signal if you leave or enter the focus of rtarea | |
if(!activeFocus) { //if you are not in the TextArea |
This file contains hidden or 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
//assets/main.qml | |
import QtQuick 2.3 | |
import QtQuick.Controls 1.4 | |
import QtQuick.Layouts 1.0 | |
import TextConverter 1.0 //The import name is the string from the first param in the qml.RegisterTypes then the number 1 is from the next param, then dot third param | |
ApplicationWindow { | |
... |
This file contains hidden or 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
//main.go | |
... | |
func run() error { | |
qml.RegisterTypes("TextConverter", 1, 0, []qml.TypeSpec{{ | |
// Above creates a importable type with an array of Type (qml.Objects) specifications | |
Init: func (h *HTMLText, obj qml.Object) { // Initializes the object and creates a pointer for HTMLText that we can reference from QML in the method we just created | |
h.Text = "Rich Text" //Sets default value... Could be anything | |
}, |
This file contains hidden or 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
//main.go | |
... | |
type HTMLText struct { | |
... | |
} | |
func (h *HTMLText) SetHTMLText(txt string) { | |
//As you can see this is a method of HTMLText that uses a pointer that we will initialize after we write this code | |
formattedTxt := blackfriday.MarkdownCommon([]byte(txt)) //blackfriday takes a byte array so we have to convert the txt string to a []byte |