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
import LeafKit | |
final class JSONifyTag: UnsafeUnescapedLeafTag { | |
func render(_ ctx: LeafContext) throws -> LeafData { | |
guard let param = ctx.parameters.first else { | |
throw "no parameter provided to JSONify" | |
} | |
return LeafData.string(param.jsonString) | |
} |
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
/* | |
`arc4random_uniform` is very useful but limited to `UInt32`. | |
This defines a generic version of `arc4random` for any type | |
expressible by an integer literal, and extends some numeric | |
types with a `random` method that mitigates for modulo bias | |
in the same manner as `arc4random`. | |
`lower` is inclusive and `upper` is exclusive, thus: | |
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
#ifndef FILEBROWSEDIALOG_HPP_ | |
#define FILEBROWSEDIALOG_HPP_ | |
#include <QThread> | |
#include <QVariant> | |
#include <bps/dialog.h> | |
/* | |
* The file browse dialog displays a dialog to browse and select | |
* files from shared folders on the system. |