Figured out my layout issue: I had set the frame on a UIView and added it to a parent view. Under the hood, iOS translated the frame rectangle to constraints (cause I hadn't set "setTranslatesAutoresizingMaskToConstraints" to false). So when the parent view was resized later, the child view stretched along with it. Unlike the default behavior views with frames set that just stay that size regardless.
View find-replace
This file contains 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
//Find: | |
var\s([A-Za-z_]+):\s?[A-Za-z!_\\?]+ | |
//Replace: | |
if(g[i]["$1"] != nil && g[i]["$1"] as? NSNull == nil){ | |
goal.$1 = g[i]["$1"] as AnyObject? as String! | |
} |
View AIR InvokeEvent Bug?
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" | |
layout="absolute" width="400" height="300" creationComplete="minimizeToDock()"> | |
<mx:Label text="Dockable" horizontalCenter="0" verticalCenter="0"> | |
</mx:Label> | |
<mx:Script> | |
<![CDATA[ | |
private function minimizeToDock():void{ | |
nativeWindow.addEventListener(Event.CLOSING, function(event:Event):void{ |
View Displacement_map.as
This file contains 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 flash.filters.DisplacementMapFilter; | |
import flash.display.BitmapData; | |
import flash.geom.Matrix; | |
import flash.geom.Point; | |
var str = 100; | |
this.addEventListener (Event.ENTER_FRAME,enterframe); |
View gist:666010
This file contains 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
<Project name=""> | |
<Task> | |
<label></label> | |
<description></description> | |
<priority></priority> | |
<due_date></due_date> | |
<depends_on></depends_on> | |
<recurring></recurring> | |
<location></location> | |
<tags></tags> |
View gist:674571
This file contains 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:(function(){readConvertLinksToFootnotes=false;readStyle='style-newspaper';readSize='size-medium';readMargin='margin-wide';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_prin |
View gist:1244268
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>Hello Canvas</title> | |
<style> | |
#can{ | |
background:#dfdfdf; | |
} |
View gist:1269327
This file contains 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
private function minimizeToDock():void{ | |
nativeWindow.addEventListener(Event.CLOSING, function(event:Event):void{ | |
event.preventDefault(); | |
nativeWindow.visible = false; | |
nativeApplication.addEventListener(InvokeEvent.INVOKE, function(event:InvokeEvent):void{ | |
trace(" Invoking..."); | |
nativeWindow.visible = true; | |
}); | |
}); | |
} |
View AndroidImageUtils.java
This file contains 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
private Bitmap getBitmapFromAsset(String strName) throws IOException | |
{ | |
AssetManager assetManager = getAssets(); | |
InputStream istr = assetManager.open(strName); | |
Bitmap bitmap = BitmapFactory.decodeStream(istr); | |
return bitmap; | |
} |
OlderNewer