this is here now: http://512pixels.net/projects/apple-collection/
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
| # coding: utf-8 | |
| from objc_util import * | |
| import console | |
| import urllib | |
| import dialogs | |
| WKWebView = ObjCClass('WKWebView') | |
| UIViewController = ObjCClass('UIViewController') | |
| UIBarButtonItem = ObjCClass('UIBarButtonItem') | |
| NSURLRequest = ObjCClass('NSURLRequest') |
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
| # Merge Script | |
| # http://code.hootsuite.com/an-introduction-to-creating-and-distributing-embedded-frameworks-in-ios/ | |
| # 1 | |
| # Set bash script to exit immediately if any commands fail. | |
| set -e | |
| # 2 | |
| # Setup some constants for use later on. |
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
| var ref = require('ref'); | |
| module.exports = BufferType; | |
| /** | |
| * Fixed length "Buffer" type, for use in Struct type definitions. | |
| * | |
| * Optionally setting the `encoding` param will force to call | |
| * `toString(encoding)` on the buffer returning a String instead. | |
| */ |
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
| <!-- | |
| This disables app transport security and allows non-HTTPS requests. | |
| Note: it is not recommended to use non-HTTPS requests for sensitive data. A better | |
| approach is to fix the non-secure resources. However, this patch will work in a pinch. | |
| To apply the fix in your Ionic/Cordova app, edit the file located here: | |
| platforms/ios/MyApp/MyApp-Info.plist | |
| And add this XML right before the end of the file inside of the last </dict> entry: |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| let fontURL = NSBundle.mainBundle().URLForResource("PillGothic300mg-bold", withExtension: "ttf") | |
| CTFontManagerRegisterFontsForURL(fontURL!, CTFontManagerScope.Process, nil) | |
| var pillGothicFontBold = UIFont(name: "PillGothic300mg-bold", size: 30) | |
| var attrs = [NSFontAttributeName : pillGothicFontBold!, |
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
| # coding: utf-8 | |
| ''' | |
| Basic theme editor for Pythonista 1.6 (beta) | |
| WARNING: Use at your own risk! User themes aren't "officially" supported, and | |
| this may break in future versions. If you enter invalid JSON or anything else | |
| that the app can't deal with, it *will* crash -- your input is not validated | |
| in any way. | |
| ''' |
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
| // Subclass -> Superclass -> NSObject | |
| // | |
| // NSObject's designated initializer is -init | |
| // Superclass's designated initializer is -initWithSomething: | |
| // Subclass's designated initializer is -initWithSomethingElse: | |
| // | |
| // Superclass cannot be initialized with -init | |
| // Subclass cannot be initialized with -init | |
| // Subclass cannot be initialized with -initWithSomething: | |
| // |
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
| // Create a new context. | |
| Local<Context> context = Context::New(isolate); | |
| // Enter the context for compiling and running the hello world script. | |
| Context::Scope context_scope(context); | |
| // Create a string containing the JavaScript source code. | |
| Local<String> source = String::NewFromUtf8(isolate, "'Hello' + ', World!'"); | |
| // Compile the source code. |
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
| set _old_delims to AppleScript's text item delimiters | |
| set AppleScript's text item delimiters to {""} | |
| tell application "System Events" | |
| set _current_app to name of the first process whose frontmost is true | |
| end tell | |
| tell application "Safari" | |
| set _urls to {} | |
| repeat with i from 1 to 6 -- how many Safari windows to show URLs from |