Skip to content

Instantly share code, notes, and snippets.

@m92o
m92o / 45.js
Last active August 29, 2015 14:03
Effective JavaScript 項目45
function Dict(elements) {
this.elements = elements || {};
this.hasSpecialProto = false;
this.specialProto = undefined;
}
Dict.prototype.has = function (key) {
if (key === "__proto__") {
return this.hasSpecialProto;
}
@m92o
m92o / app.js
Created February 26, 2011 17:46
Ti.UI.TextArea.keyboardToolbar is not displayed at modal window. (Titanium Mobile 1.6 / iOS SDK 4.2)
var window = Ti.UI.createWindow({
modal: true, // If this line is deleted, keyboardToolbar is displayed.
title: 'window',
backgroundColor: '#fff'
});
var trash = Ti.UI.createButton({
systemButton: Ti.UI.iPhone.SystemButton.TRASH
});
var textarea = Ti.UI.createTextArea({
editable: true,
// ipa2epub.scala
// usage: scala ipa2epub.scala src.ipa [dst.epub]
// TODO: error handling
import java.io.{ File, FileInputStream, FileOutputStream, BufferedInputStream }
import java.util.zip.{ ZipFile, ZipEntry, ZipOutputStream, CRC32 }
import scala.util.matching.Regex
val TopDir = "Payload"
def die(message: String) {