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
struct Settings { | |
static var documentSelected = false | |
} | |
struct FolderPage: View { | |
@State var documentsLabel: String = Settings.documentSelected ? "Selected" : "Not selected" | |
var body: some View { | |
VStack { | |
VStack { |
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
// How is it I can use SF Symbols images in text strings? | |
echo >bug.txt | |
hexdump bug.txt | |
> f4 80 8c 9b | |
f4 = 11110100 | |
80 = 10000000 | |
8c = 10001100 | |
9b = 10011011 |
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
#!/bin/swift | |
// Print all the characters in the "Supplementary Private Use Area-B" block. | |
import Cocoa | |
for ch:UInt32 in 0x100000..<0x10FFFF { | |
let arr = [ch] | |
let array: [UInt32] = [CFSwapInt32(ch)] | |
let data = array.withUnsafeBytes { (ptr) -> Data in |
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 SwiftUI | |
import PlaygroundSupport | |
struct SignUpView: View { | |
@State var username = "" | |
@State var password = "" | |
@State var loggedIn = false | |
var body: some View { | |
NavigationView { |
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
// Properties: | |
@property (nonatomic) BOOL shouldReloadCollectionView; | |
@property (strong, nonatomic) NSMutableArray *collectionViewUpdateBlocks; | |
// NSFetchedResultsController Delegate Methods: | |
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller | |
{ | |
self.shouldReloadCollectionView = NO; |
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
const { RTMClient, WebClient } = require('@slack/client'); | |
var CLIENT_EVENTS = require('@slack/client').CLIENT_EVENTS; | |
const token = 'xoxb-token-here'; | |
async function runBot() { | |
const rtm = new RTMClient(token); | |
const web = new WebClient(token); | |
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
1. Download the Windows Service Wrapper binary from this project: https://github.com/kohsuke/winsw | |
2. Copy to your Buildkite directory and rename to "buildkite-service.exe" | |
3. Create buildkite-service.xml: | |
<service> | |
<id>buildkite-service</id> | |
<name>buildkite-service</name> | |
<description>The BuildKite build agent.</description> |
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 <Foundation/Foundation.h> | |
#include "libavcodec/avcodec.h" | |
#include "libavformat/avformat.h" | |
#include "libswscale/swscale.h" | |
#include <libavutil/imgutils.h> | |
uint64_t getNanoseconds(void); |
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
#!/usr/bin/swift | |
// Swift script to search for Bonjour services on the local network. | |
// Found services are printed to the console. | |
import Foundation | |
import CoreFoundation | |
// Inner search, finds services of a particular type |
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
(lldb) p types | |
([String]) $R0 = 56 values { | |
[0] = "video/mp4" | |
[1] = "video/x-m4v" | |
[2] = "video/mpg" | |
[3] = "audio/x-m4r" | |
[4] = "audio/AMR" | |
[5] = "video/x-mpg" | |
[6] = "video/3gpp2" | |
[7] = "video/mp2p" |
NewerOlder