⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.
As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.
Here's how to get it set up on Mac OS X:
-
OpenConnect can be installed via homebrew:
brew update
brew install openconnect
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request | |
navigationType:(UIWebViewNavigationType)navigationType { | |
NSString *urlString = [[request URL] absoluteString]; | |
if ([urlString hasPrefix:@"js:"]) { | |
NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] | |
stringByReplacingPercentEscapes]; | |
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; | |
NSError *error; |
#!/usr/bin/env bash | |
# Set up the environment. | |
set -e | |
POW_ROOT="$HOME/Library/Application Support/Pow" | |
POW_CURRENT_PATH="$POW_ROOT/Current" | |
POW_VERSIONS_PATH="$POW_ROOT/Versions" | |
POWD_PLIST_PATH="$HOME/Library/LaunchAgents/cx.pow.powd.plist" | |
FIREWALL_PLIST_PATH="/Library/LaunchDaemons/cx.pow.firewall.plist" |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
The IMAP protocol workflow consists of the following steps,
- A network connection established between the client and the server.
- A greeting message sent by the server indicating that the client has successfully connected.
- A series of interactions between the client and server.
The interactions consists of strings of lines, i.e. string terminated by a carriage return and a line feed (CRLF or \r\n). Interactions can be both commands (sent by clients) and data (sent by clients and servers). Both the client and the server strictly interact using lines or known length octet streams (8-bit characters) followed by a line.
####Client
An IMAP client issues commands to the server in a CRLF terminated string. The syntax of a command includes a tag, followed by the command and parameters. A tag is an alphanumeric identifier and each client command has a different tag for that session. A tag could be something like but not limited to A1, A2 etc.
// Thanks to http://www.labs.saachitech.com/2012/10/23/pdf-generation-using-uiprintpagerenderer | |
// Note: including images in the HTML won't work, see here: | |
// https://github.com/nyg/HTMLWithImagesToPDF | |
import UIKit | |
// 1. Create a print formatter | |
let html = "<b>Hello <i>World!</i></b>" | |
let fmt = UIMarkupTextPrintFormatter(markupText: html) |
func modelIdentifier() -> String? { | |
let service: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")) | |
let cfstr = "model" as CFString | |
if let model = IORegistryEntryCreateCFProperty(service, cfstr, kCFAllocatorDefault, 0).takeUnretainedValue() as? NSData { | |
if let nsstr = NSString(data: model, encoding: NSUTF8StringEncoding) { | |
return nsstr as String | |
} | |
} | |
return nil | |
} |
import Cocoa | |
// https://github.com/DouglasHeriot/AutoGrowingNSTextField | |
// for AutoLayout | |
class AutoGrowingTextField: NSTextField { | |
var minHeight: CGFloat? = 100 |
var serialNumber: String? { | |
let platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice") ) | |
guard platformExpert > 0 else { | |
return nil | |
} | |
guard let serialNumber = (IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformSerialNumberKey as CFString, kCFAllocatorDefault, 0).takeUnretainedValue() as? String)?.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) else { | |
return nil | |
} |