Skip to content

Instantly share code, notes, and snippets.

View matt-curtis's full-sized avatar

Matt Curtis matt-curtis

View GitHub Profile
@matt-curtis
matt-curtis / gist:d9b46b59834dc781cd6e
Last active August 29, 2015 14:15
Fireworks Errata, Part 2

Weird $ Variable. On further inspection seems to be a light implemtation of a variable from ExtendScript?? http://jongware.mit.edu/idcs6js/pc_%24.html

$.evalFile(filename:String, timeout:int) // not sure if fw cares about timeout
$.getenv(str:String) // gets enviroment variables...interesting

Fireworks Document

dom.saveAllAsync()
dom.saveDocumentAsync()
dom.saveDocumentAsAsync(doc, saveAsCmd:Boolean)
@matt-curtis
matt-curtis / Complete Fireworks Event List.md
Created January 5, 2015 14:50
Complete Fireworks Event List (as of CS6)

Events not mentioned in the official documentation have an asterick beside them.

IsFwCallbackInstalled*
onFwEnterSymbolEdit*
onFwStopMovie
onFwStartMovie
onFwWidgetLibraryChange*
onFwWindowFocusChange*
onFwSystemColorChanged*

onFwDocumentSave

@matt-curtis
matt-curtis / Fireworks CSXS Notes.md
Last active August 29, 2015 14:12
Fireworks CSXS Notes

Building CSXS extensions for Fireworks with Adobe Flash Builder 4.x

1.) Fireworks does not have it's own CSWSBlaBlaLib to encapsulate DOM manipulation from AS3. You can only use this to execute JS functions (defined in your CSXS manifest.xml)

CSInterface.instance.evalScript("jsFunctionName", ..params);

This method is even more fun than the MMExecute method you'd be using if you were writing a normal panel, becuase all return objects have to be an XML string. I'm not kidding you. XML. You know, the markup format that is most well known for its use in RSS feeds.

@matt-curtis
matt-curtis / gist:c0fa7aa820d6257e7b2a
Last active August 21, 2019 13:49
UINavigationBar Multiline Title
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if(!self.navigationItem.titleView){
self.navigationItem.titleView = ({
UILabel *titleView = [UILabel new];
titleView.numberOfLines = 0;
titleView.textAlignment = NSTextAlignmentCenter;
titleView.attributedText = [[NSAttributedString alloc] initWithString:@"2\nLINES" attributes:
self.navigationController.navigationBar.titleTextAttributes
@matt-curtis
matt-curtis / gist:0ba79643a7412b1dd64a
Last active August 29, 2015 14:07
XPath + Text Nodes
var getNodeTreeXPath = function(node){
// Built from Firebug source -
// https://github.com/firebug/firebug/blob/235efff40332f85cb34b55f2da0de6bf98d083e4/extension/content/firebug/lib/xpath.js
var paths = [], nodePath, element = node;
// If text node find its place among its siblings
if(element.nodeType == Node.TEXT_NODE){
var siblings = node.parentElement.childNodes;
var nodeIndex = Array.prototype.indexOf.call(siblings, node)+1;
@matt-curtis
matt-curtis / gist:b92dc5987a9c423968de
Last active May 18, 2018 18:11
Google Apps Scripts - Loading external libraries/javascript
/*
1.) Add any extra libraries as "html" files (New > HTML File)
*/
/* 2.) */ eval(HtmlService.createTemplateFromFile("JSLib").getRawContent()); /* exclude the .html extension */
@matt-curtis
matt-curtis / gist:6b9235f3a3e94ce9145d
Last active September 11, 2017 08:35
Disable animation in UINavigationBar
@implementation MyNavBar
- (NSArray*) subviews {
NSArray *subviews = [super subviews];
if(_animationDisabled) [self removeAllAnimationsInViews:subviews];
return subviews;
}
@matt-curtis
matt-curtis / NumberPadDoneBtn.h
Last active December 31, 2020 14:29
Done Button for UIKeyboard NumberPad (must be set as inputAccessoryView)
#import <UIKit/UIKit.h>
@interface NumberPadDoneBtn : UIView
@end
@interface NumberPadButton : UIButton
@end
@matt-curtis
matt-curtis / gist:f9efbd2c2df1b77e3471
Last active January 22, 2018 14:48
Get number of lines in UITextView (iOS 7 compat.)
id<UITextInputTokenizer> tokenizer = textView.tokenizer;
UITextPosition *pos = textView.endOfDocument;
NSInteger lines = 0;
while (true){
UITextPosition *lineEnd = [tokenizer positionFromPosition:pos toBoundary:UITextGranularityLine inDirection:UITextStorageDirectionBackward];
if([textView comparePosition:pos toPosition:lineEnd] == NSOrderedSame){
pos = [tokenizer positionFromPosition:lineEnd toBoundary:UITextGranularityCharacter inDirection:UITextStorageDirectionBackward];
@matt-curtis
matt-curtis / AppSwitcher.as
Created March 26, 2014 13:23
Application Subclass for...switching between application instances...
package
{
import flash.events.Event;
import mx.controls.SWFLoader;
import mx.core.Application;
import mx.managers.SystemManager;
public class AppSwitcher extends Application
{