Skip to content

Instantly share code, notes, and snippets.

View lynxerzhang's full-sized avatar
🎯
Focusing

frankwinter lynxerzhang

🎯
Focusing
  • geckostudio
  • shanghai
View GitHub Profile
@desandro
desandro / jquery-layout-review.md
Created January 28, 2013 18:13
layout thrashing in jQuery
@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:
@jo
jo / js-crypto-libraries.md
Last active January 17, 2026 16:10
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.

@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();
@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 / 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()
{
@sebmarkbage
sebmarkbage / JSXSpreadAttributes.md
Last active March 23, 2026 03:02
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

@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; })()
@DavidWells
DavidWells / clear-browser-cache.js
Last active February 24, 2021 09:55
Clear Browser cache. Run in your browsers javascript console
//Cache Buster
(function (){
  var rep = /.*\?.*/,
      links = document.getElementsByTagName('link'),
      scripts = document.getElementsByTagName('script'),
      process_scripts = false;
  for (var i=0;i<links.length;i++){
    var link = links[i],
        href = link.href;
    if(rep.test(href)){
@JadenGeller
JadenGeller / Inout.swift
Last active September 6, 2022 23:19
Inout is really UnsafeMutablePointer!
var a = 0
var b = 0
// UnsafeMutablePointer definition
func test2(x: UnsafeMutablePointer<Int>) {
x.memory += 1
// We have to manually dereference x within this method
}
// Inout definition