Skip to content

Instantly share code, notes, and snippets.

View lynxerzhang's full-sized avatar
🤒

frankwinter lynxerzhang

🤒
  • geckostudio
  • shanghai
View GitHub Profile
@JamesDunne
JamesDunne / detect_flash.js
Created July 9, 2014 12:29
Flash plugin detection javascript code; works on IE8 and Chrome
// Returns true or false if flash installed or not. Tested with IE8 on Windows 7 and Chrome on Win7 and Mac.
(function() { var ie_flash; try { ie_flash = (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) !== false) } catch(err) { ie_flash = false; } var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || ie_flash); return _flash_installed; })()
@sebmarkbage
sebmarkbage / JSXSpreadAttributes.md
Last active August 13, 2020 15:18
JSX Spread Attributes

JSX Spread Attributes

If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:

  var component = <Component foo={x} bar={y} />;

Mutating Props is Bad, mkay

@lynxerzhang
lynxerzhang / ExportSwf.jsfl
Created February 27, 2014 12:26
export fla to swf (导出指定目录下的fla文件)
var doc = null;
var flaPath = null;
var outputPath = null;
var recursiveSearch = true;
var suffix = "fla";
run();
function run()
{
@lynxerzhang
lynxerzhang / FindMatchClassNameItem.jsfl
Last active August 29, 2015 13:56
find library asset by linkage class name (根据输入的链接类名寻找库中是否存在指定资源)
var doc = fl.getDocumentDOM();
var library = null;
var items = null;
var itemLen = null;
var item = null;
run();
function run()
{
@lynxerzhang
lynxerzhang / StageMatchContent.jsfl
Last active April 24, 2019 03:28
set Flash IDE's stage to match content's size(设置舞台的长宽以匹配舞台中放置的mc元件)
//@see http://keith-hair.net/blog/2010/03/21/resizing-flash-documents-to-fit-contents-in-jsfl/
//@see http://stackoverflow.com/questions/8056990/how-does-one-get-the-stroked-bounds-of-a-symbol-in-jsfl
var doc = fl.getDocumentDOM();
var timeline = doc.getTimeline();
var layer = null;
var frame = null;
var element = null;
run();
@jo
jo / js-crypto-libraries.md
Last active January 16, 2025 12:08
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@jcward
jcward / StreamVideo.as
Created October 25, 2013 19:04
A simple example of playing a video stream in Flash (and vlc commands for serving the stream)
/**
* Streaming Video Test
*
* References:
* -----------
* http://serverfault.com/questions/288137/how-to-stream-live-video-from-a-linux-server
* https://wiki.videolan.org/Stream_VLC_to_Website_with_asf_and_Flash#Method_2_H264_and_Flash_.flv
* http://blog.morscad.com/code-snippets/creating-a-video-player-in-as3-using-netstream/
*
* Sample videos:
@desandro
desandro / jquery-layout-review.md
Created January 28, 2013 18:13
layout thrashing in jQuery
@snowman-repos
snowman-repos / gist:3825198
Created October 3, 2012 05:28
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)
@harryxu
harryxu / cnv.sh
Created September 19, 2012 11:13
#!/usr/bin/env bash
CURRENT_PATH=`pwd`
outdir="$CURRENT_PATH/out"
if [[ ! -d $outdir ]]; then
mkdir $outdir
fi
cd "$CURRENT_PATH/origin"
VIDEOS=`find . -name "*"`