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 Cocoa | |
import Foundation | |
// Move around and click automatically at random places in macos, kinda human like in a cheap way. | |
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at | |
// each point with the point as argument. | |
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) { | |
let screenSize = NSScreen.main?.visibleFrame.size |
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 AppKit | |
class HoverView: NSView { | |
override var wantsUpdateLayer: Bool { | |
return true | |
} | |
private var isMouseOver = false { | |
didSet { |
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
#!/bin/sh | |
#Run this script after imaging a machine, this can run as a first run script (at REBOOT), but needs no parameters set if used from the Casper Suite | |
# Determine OS version | |
osvers=$(sw_vers -productVersion | awk -F. '{print $2}') | |
sw_vers=$(sw_vers -productVersion) | |
# Determine OS build number | |
sw_build=$(sw_vers -buildVersion) |
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
LOCATION="${BUILT_PRODUCTS_DIR}"/"${FRAMEWORKS_FOLDER_PATH}" | |
# By default, use the configured code signing identity for the project/target | |
#IDENTITY="${CODE_SIGN_IDENTITY}" | |
IDENTITY="${EXPANDED_CODE_SIGN_IDENTITY_NAME}" | |
if [ "$IDENTITY" == "" ] | |
then | |
# If a code signing identity is not specified, use ad hoc signing | |
IDENTITY="-" | |
fi |
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
Merus-Mac-mini:Sparkle-ui-separation-and-xpc meru$ make release | |
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "/var/folders/7q/2cq4mfm560g0cynz6t84zm1m0000gn/T//Sparkle.P2NhnD" build | |
User defaults from command line: | |
IDEDerivedDataPathOverride = /var/folders/7q/2cq4mfm560g0cynz6t84zm1m0000gn/T/Sparkle.P2NhnD | |
note: Using new build system | |
note: Planning build | |
note: Constructing build description | |
Build system information | |
warning: SparkleDownloader isn't code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it. (in target 'SparkleDownloader') |
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
let fontFamilies = NSFontManager.shared.availableFontFamilies | |
for (index, family) in fontFamilies.enumerated() { | |
print("\(index). \(family)") | |
} | |
let fonts = NSFontManager.shared.availableFonts | |
for (index, font) in fonts.enumerated() { | |
print("\(index). \(font)") | |
} |
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
//http://www.markcornelisse.nl/cocoa/cocoa-hardware-identifier-inside-os-x/ | |
import Foundation | |
import IOKit | |
public var hardwareUUID: NSUUID = { | |
var hwUUIDBytes: [UInt8] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | |
var ts = timespec(tv_sec: 0,tv_nsec: 0) | |
gethostuuid(&hwUUIDBytes, &ts) | |
return NSUUID(UUIDBytes: hwUUIDBytes) | |
}() |
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
// Center horizontally | |
var constraints = NSLayoutConstraint.constraintsWithVisualFormat( | |
"V:[superview]-(<=1)-[label]", | |
options: NSLayoutFormatOptions.AlignAllCenterX, | |
metrics: nil, | |
views: ["superview":view, "label":label]) | |
view.addConstraints(constraints) | |
// Center vertically |
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
Quit Xcode. | |
Open Terminal. | |
Typed Command xattr -rc /Users/manabkumarmal/Desktop/Projects/MyProjectHome | |
Open Xcode. | |
Cleaned. | |
Now worked and No Error. |
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
// JavaScript Document | |
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale |
NewerOlder