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
var style = document.createElement('style'); | |
style.appendChild(document.createTextNode('#sample { background-color: #FF0000; }')); | |
document.documentElement.appendChild(style); | |
window.addEventListener('DOMContentLoaded', function () { | |
document.head.appendChild(style); | |
}, false); |
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
> require('fs').statSync('/usr') | |
{ dev: 234881026, | |
ino: 369622, | |
mode: 16877, | |
nlink: 14, | |
uid: 0, | |
gid: 0, | |
rdev: 0, | |
size: 476, | |
blksize: 4096, |
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
$(function () { | |
$.ajax({ | |
type: 'GET', | |
cache: false, | |
url: location.href, | |
complete: function (req, textStatus) { | |
var dateString = req.getResponseHeader('Date'); | |
if (dateString.indexOf('GMT') === -1) { | |
dateString += ' GMT'; | |
} |
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
var text:String = 'abc0123456789'; | |
var a:XML = <a><![CDATA[{text}]]></a>; | |
trace(a.toXMLString()); // <a><![CDATA[{text}]]></a>; | |
var b:XML = <b>{'<![CDATA[' + text + ']]>'}</b>; | |
trace(b.toXMLString()); // <b><![CDATA[abc0123456789]]></b> | |
var c:XML = <c>{new XML('<![CDATA[' + text + ']]>')}</c>; | |
trace(c.toXMLString()); // <c><![CDATA[abc0123456789]]></c> |
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
public function resizeLowQuality(src:BitmapData, width:Number, height:Number):BitmapData { | |
var matrix:Matrix = new Matrix(); | |
matrix.scale(width / src.width, height / src.height); | |
var dst:BitmapData = new BitmapData(width, height, true, 0); | |
dst.draw(src, matrix, null, null, null, true); | |
return dst; | |
} | |
public function resizeHighQuality(src:BitmapData, width:Number, height:Number):BitmapData { | |
var bitmap:Bitmap = new Bitmap(src, 'auto', true); |
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
/** | |
* @mxmlc -load-config+=obj\{PROJECT_NAME}Config.xml -debug=true -incremental=true -benchmark=false -static-link-runtime-shared-libraries=true -o bin/{FILE_NAME}.swf | |
*/ |
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 org.libspark.ui.SWFWheel; | |
SWFWheel.initialize(stage); | |
SWFWheel.browserScroll = false; |
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
package { | |
public function print(...texts):void { | |
if (printable) { | |
trace.apply(null, texts); | |
} | |
} | |
} |
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
npm install http-proxy |
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
var connection:NetConnection = new NetConnection(); | |
connection.connect(null); | |
var stream:NetStream = new NetStream(connection); | |
stream.client = {}; | |
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatus); | |
stream.play('example.f4v'); | |
setTimeout(function ():void { | |
stream.seek(100); | |
}, 5000); |
OlderNewer