View Blobs.swift
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
// | |
// Blobs.swift | |
// SwiftUI Demos | |
// | |
// Created by Morten Just on 1/31/23. | |
// | |
import SwiftUI | |
struct Blobs: View { |
View DarkMode.swift
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
// | |
// DarkModeMasker.swift | |
// SwiftUI Demos | |
// | |
// Created by Morten Just on 1/22/23. | |
// https://twitter.com/joshguospace/status/1617101052192649216?s=12 | |
import SwiftUI | |
import Charts |
View DarkModeSwitch.swift
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
// | |
// DarkModeMasker.swift | |
// SwiftUI Demos | |
// | |
// Created by Morten Just on 1/22/23. | |
// https://twitter.com/joshguospace/status/1617101052192649216?s=12 | |
import SwiftUI | |
import Charts |
View TwitterBluePlus.swift
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 | |
// MARK: Main | |
struct TwitterBluePlus: View { | |
@State var topMenuItems : [MenuItem] = [MenuItem(title: "For you", icon: nil), MenuItem(title: "Following", icon: nil)] | |
@State var selectedIdx = 0 | |
var selected : MenuItem { topMenuItems[selectedIdx] } |
View NSImage + withoutAlpha.swift
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
extension NSImage { | |
func withoutAlpha() -> NSImage? { | |
// based on https://gist.github.com/mishimay/7b65167cf829e022f46dfa749d018661 | |
guard let cgImage = self.cgImage(forProposedRect: nil, context: nil, hints: nil) else { return nil } | |
let context = CGContext(data: nil, width: cgImage.width, height: cgImage.height, bitsPerComponent: cgImage.bitsPerComponent, bytesPerRow: cgImage.bytesPerRow, space: cgImage.colorSpace!, bitmapInfo: CGImageAlphaInfo.noneSkipLast.rawValue)! | |
context.draw(cgImage, in: CGRect(x: 0, y: 0, width: context.width, height: context.height)) | |
guard let newCg = context.makeImage() else { return nil } | |
return NSImage(cgImage: newCg, size: .zero) |
View WeatherKit.ts
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
export interface WeatherKit { | |
currentWeather: CurrentWeather; | |
forecastDaily: ForecastDaily; | |
forecastHourly: ForecastHourly; | |
} | |
export interface CurrentWeather { | |
name?: string; | |
metadata?: Metadata; | |
asOf?: Date; |
View AR glasses
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
Company: Apple | |
Product: Apple AR Glasses | |
Short emotional tagline: The future is closer than it appears | |
Script: | |
In our lifetimes we’ve seen technology change our lives | |
In ways we couldn’t imagine | |
In the past decade alone, it’s become an extension of who we are | |
So when we talk about the future | |
We don’t just mean flying cars and robots | |
We mean a future where we’re not tethered to our screens |
View Danish ad
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
Company: Danske Bank | |
Product: Vi låner penge ud til folk og tager renter | |
Short emotional tagline: Får du en god idé? | |
Script: | |
Hvad gør du, når du får en god idé? | |
Har du modet til at tro på den og gøre noget ved den? | |
Er du bange for, at andre vil tage din idé og gøre den bedre? | |
Eller er du bare bange for at tabe? | |
Så hvad gør du? | |
Siger du fra og sætter en stopper for din drøm? |
View gist:cbae4bb40a558752c2ead7a874635e0d
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
The following are tv commercials in the style of a highly emotional lifestyle branding campaign from Nike. They are inspirational and upbeat. Feel something. Dream bigger. The script contains 11 short lines. | |
Company: Nike | |
Product: Shoes | |
Short emotional tagline: Never too far down | |
Script: | |
We've all been underestimated and counted out | |
In those moments we felt like it was over | |
But it's when we're given no chance | |
that we somehow found that last bit of strength to keep fighting |
View gist:8ab8eb3774a02ac27c7cefc0af5c5244
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
let task = Process() | |
var args = [String]() | |
args.append("-c") | |
let bundle = Bundle.main.bundlePath | |
args.append("sleep 0.2; open \"\(bundle)\"") | |
task.launchPath = "/bin/sh" | |
task.arguments = args | |
task.launch() | |
NSApplication.shared().terminate(nil) |
NewerOlder