The watch is a little different from the phone but has the same states
- not running
- inactive
- active
- background
- suspended
// | |
// ExtensionURLRequest.swift | |
// | |
// Created by Abhishek Maurya on 16/07/20. | |
// Copyright © 2020. All rights reserved. | |
// | |
import Foundation | |
extension URLRequest { |
// super rusty on combine | |
// https://brightdigit.com/tutorials/combine-corelocation-publishers-delegates/ | |
class CLLocationManagerPublicist: NSObject, CLLocationManagerCombineDelegate { | |
... | |
let locationSubject = PassthroughSubject<[CLLocation], Never>() | |
func locationPublisher() -> AnyPublisher<[CLLocation], Never> { | |
return locationSubject.eraseToAnyPublisher() | |
} | |
func locationManager(_: CLLocationManager, didUpdateLocations locations: [CLLocation]) { |
Add a space in a state name
stateDiagram
classDef yourState font-style:italic,font-weight:bold,fill:white
yswsii: Your state with spaces in it
[*] --> yswsii:::yourState
// https://stackoverflow.com/a/43532815/1492368 | |
extension SKSpriteNode { | |
func addSkew(value: CGFloat = -1){ | |
var effectNode = SKEffectNode() | |
effectNode.shouldRasterize = true | |
effectNode.shouldEnableEffects = true | |
effectNode.addChild(SKSpriteNode(texture: texture)) |
Rust is a ahead of time compile language. What is llvm the power behind swift rust clang and more
fn main() {
// ! means it's a macro
println!("Hello, World!");
}
// from O'Reilly Web Dev with Node & Express | |
const http = require('http') | |
const fs = require('fs') | |
const port = process.env.PORT || 3000 | |
function serveStaticFile(res, path, contentType, responseCode = 200) { | |
fs.readFile(__dirname + path, (err, data) => { | |
if(err) { | |
res.writeHead(500, { 'Content-Type': 'text/plain' }) |
## Unity ## | |
*.cs diff=csharp text | |
*.cginc text | |
*.shader text | |
*.mat merge=unityyamlmerge eol=lf | |
*.anim merge=unityyamlmerge eol=lf | |
*.unity merge=unityyamlmerge eol=lf | |
*.prefab merge=unityyamlmerge eol=lf |