This file contains hidden or 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
| <!-- modified from http://alex.dojotoolkit.org/08/jscript/lettable.html --> | |
| <html> | |
| <head> | |
| <title>A Crazy Getter/Setter Hack</title> | |
| </head> | |
| <body> | |
| <script language="VBScript" type="text/VBScript"> | |
| Function exec_vb_global(code) | |
| ExecuteGlobal(code) | |
| End Function |
This file contains hidden or 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
| // WSH | |
| function zip(zipfile, files) { | |
| var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
| var shell = new ActiveXObject("Shell.Application"); | |
| var process_id = get_process_id(); | |
| // create empty zip (right click -> new file -> compressed (zipped) folder) | |
| var zip = fso.CreateTextFile(zipfile, true); |
This file contains hidden or 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.prototype.notifier = (function () {"use strict"; | |
| // (C) WebReflection - Mit Style License | |
| function create(callback) { | |
| function notifier() { | |
| var args = [].slice.call(arguments), output; | |
| if (fire(notifier, "before", callback, this, args, null)) { | |
| try { | |
| output = callback.apply(this, args); | |
| } catch(e) { | |
| fire(notifier, "error", callback, this, args, e); |
This file contains hidden or 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
| // I know it's for demo purpose from MS: | |
| // http://ie.microsoft.com/testdrive/HTML5/TypedArrays/js/binaryReader.js | |
| BinaryReader.prototype = { | |
| readUint8: function () { var result = this.dataView.getUint8(this.streamPosition, true); this._movePointerTo(this.streamPosition + 1); return result; }, | |
| readInt8: function () { var result = this.dataView.getInt8(this.streamPosition, true); this._movePointerTo(this.streamPosition + 1); return result; }, | |
| readUint16: function () { var result = this.dataView.getUint16(this.streamPosition, true); this._movePointerTo(this.streamPosition + 2); return result; }, | |
| readInt16: function () { var result = this.dataView.getInt16(this.streamPosition, true); this._movePointerTo(this.streamPosition + 2); return result; }, | |
| readUint32: function () { var result = this.dataView.getUint32(this.streamPosition, true); this._movePointerTo(this.streamPosition + 4); return result; }, | |
| readInt32: function () { var result = this.dataView.getInt32(this.s |
This file contains hidden or 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
| // MD5cmd.js | |
| // (C) aya_eiya 2012 | |
| (function (){ | |
| function readBinaryFile(FileName){ | |
| var streamObj = new ActiveXObject("ADODB.Stream"); | |
| var resultObj = null; | |
| streamObj.Type = 1; | |
| streamObj.Open(); | |
| streamObj.LoadFromFile(FileName); |
This file contains hidden or 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 Bloop() { } | |
| var bloop = new Bloop(); | |
| bloop.constructor === Bloop; // and indeed, | |
| bloop.constructor === Bloop.prototype.constructor; |
This file contains hidden or 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 print(text) { | |
| WScript.Echo('> ' + text); | |
| } | |
| var stdin = WScript.StdIn; | |
| var stdout = WScript.StdOut; | |
| var input; | |
| do { | |
| var input = stdin.ReadLine(); |
This file contains hidden or 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
| // httpget.js: download a file (Windows Script Host) | |
| // usage: cscript httpget.js <url> <file> | |
| (function() { | |
| if (WScript.Arguments.Length != 2) { | |
| WScript.Echo("Usage: httpget.js <url> <file>") | |
| WScript.Quit(1) | |
| } | |
| var url = WScript.Arguments(0) |
This file contains hidden or 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>Creating A Dynamic Scope Chain For Method Execution</title> | |
| <script type="text/javascript"> | |
| // I return a function with a "scope" property that can be | |
| // used to alter the runtime bindings of the functions. | |
| var getFoo = (function(){ |
This file contains hidden or 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
| /*! (c) 2016 Andrea Giammarchi - MIT Style License */ | |
| // simple state-like objects handler | |
| // based on prototypal inheritance | |
| function State() {'use strict';} | |
| // States are serializable dictionaries | |
| // toJSON and toString are the only reserved keywords | |
| // every other name can be used as name (included __proto__) |
OlderNewer