The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Revised by Bytes Unlimited : June 14th 2017
// The SwiftUI Lab | |
// Website: https://swiftui-lab.com | |
// Article: https://swiftui-lab.com/alignment-guides | |
import SwiftUI | |
struct ContentView: View { | |
@State var position: Int = 0 | |
var body: some View { |
/** | |
* MacEditorTextView | |
* Copyright (c) Thiago Holanda 2020-2021 | |
* https://twitter.com/tholanda | |
* | |
* MIT license | |
*/ | |
import Combine | |
import SwiftUI |
import dateMixin from './mixins/date'; | |
// Globally | |
Vue.mixin(dateMixin); |
// Swift enums cannot be declared with a rawValue if they have associated values | |
// like good ol' Amargasaurus has. Using String(describing: dino) on a case with | |
// associated also includes the values, but works fine on unassociated cases. | |
// Mirror(reflecting: dino) can extract the name of an associated case, but is | |
// nil for unassociated cases. Our hero ?? swoops in to save the day! | |
enum Sauropoda { | |
case Amargasaurus(things: Int64, hasOtherThing: Bool?) | |
case Antetonitrus | |
// ... |
func jpegDataFrom(image:NSImage) -> Data { | |
let cgImage = image.cgImage(forProposedRect: nil, context: nil, hints: nil)! | |
let bitmapRep = NSBitmapImageRep(cgImage: cgImage) | |
let jpegData = bitmapRep.representation(using: NSBitmapImageRep.FileType.jpeg, properties: [:])! | |
return jpegData | |
} |
------------------------------------------------ | |
-- Settings Start: Change these as needed | |
global gDest | |
set gDest to "/Volumes/MacPhotos/Pictures/ExportAlbums/" as POSIX file as text -- the destination folder (use a valid path) | |
global gLogFile | |
set gLogFile to gDest & "ExportAlbumToFolders.log" | |
global gKeywordOnSuccess | |
set gKeywordOnSuccess to "exported" |
Revised: 2019-11-28 16:16 GMT-6
This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.
I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.
#!/bin/bash | |
# A script to set up a new mac. Uses bash, homebrew, etc. | |
# Focused for ruby/rails development. Includes many utilities and apps: | |
# - homebrew, rvm, node | |
# - quicklook plugins, terminal fonts | |
# - browsers: chrome, firefox | |
# - dev: iterm2, sublime text, postgres, chrome devtools, etc. | |
# - team: slack, dropbox, google drive, skype, etc |
# IMPORTANT SETUP INSTRUCTIONS: | |
# | |
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary) | |
# 2. Select "Create App" | |
# 3. Select the following settings: | |
# * "Dropbox API app" | |
# * "Files and datastores" | |
# * "(No) My app needs access to files already on Dropbox" | |
# * "All file types" | |
# * (Choose any app name) |