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 XHConn() | |
{ | |
var xmlhttp, bComplete = false; | |
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } | |
catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } | |
catch (e) { try { xmlhttp = new XMLHttpRequest(); } | |
catch (e) { xmlhttp = false; }}} | |
if (!xmlhttp) return null; | |
this.connect = function(sURL, sMethod, sVars, fnDone) | |
{ |
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 Foo() { | |
if (this == window) { | |
var F = function(){ }; | |
F.prototype = Foo.prototype; | |
var inst = new F(); | |
Foo.apply(inst, arguments); | |
return inst; | |
} | |
else { | |
this.init.apply(this, arguments); |
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 ok1, ok2, ok3, ok4, ok5, ok6; | |
function A(){ | |
ok1 = (this.constructor!=arguments.callee); | |
}; | |
function B(){ | |
ok2 = (this.constructor==arguments.callee); | |
}; | |
A(); |
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
This gist aims to prove or disprove the assertion made here[1] and linked on | |
Ajaxian[2] that dynamic script requests, or more specifically JSONP requests, | |
leak memory in all modern browsers. | |
The specific setup is a 200ms interval that requests an uncached script pointed at | |
the simple php file. This file in response sends the following string: | |
update() | |
This is not technically a JSONP response, since the would-be callback is executed | |
without arguments. However, memory footprint results can be gauged on generic |
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
// Bookmaklet below | |
javascript:(function(d) {var mysqlID = d.cookie.match(/(?:^|\s)bugtraq:uniqueID=([^;]+)/) && RegExp.$1, elem = d.selectSingleNode('//a[starts-with(@href, "mailto:") and contains(@href, "@bugs.opera.com")]'), bugID = elem && elem.href && elem.href.match(/mailto:([^@]+)@/) && RegExp.$1 || '?', closing = '\n\nThank you,\n\nBugtraq Staff'; if (mysqlID && bugID) { d.body.appendChild(d.createElement('script')).src = 'http://opera.remcol.ath.cx/bugs/userjs.php?mysqlid=' + mysqlID + '&bugid=' + bugID; alert('Your bug has been traqed.' + closing); } else { alert('There was a problem logging your bug to the public database. Please report the failure here:\n\nhttp://my.opera.com/community/forums/topic.dml?id=217364\n\nPlease include the following details:\n\n* bug title\n' + (mysqlID ? '* internal ID: ' + mysqlId + '\n' : '') + '* external ID: ' + bugID + closing); }})(this.document); | |
// This is what the code looks like prettified | |
(function(d) { | |
var mysqlID = d.cookie.match(/(?:^|\s)bugtraq: |
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(slice, toString) { | |
// opera bug - DSK-259939 | |
var arrayMethodsFailOnStrings = Array.prototype.filter.call('fPaAiSlS', function(c) { | |
return 'fail'.indexOf(c) == -1; | |
}).join('') != 'PASS'; | |
function addGenerics(klass, methods) { | |
methods.forEach(function(name) { | |
if ((typeof klass.prototype[name] == 'function') && !klass[name]) { | |
klass[name] = (function(fn, isArray) { |
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
@echo off | |
REM save this file as a .bat or .cmd file and call it from anywhere | |
set _installName=Opera | |
if NOT #%1# == ## (for /f "useback tokens=*" %%a in ('%1') do (set _installName=%%~a)) | |
if exist "%appdata%\Opera\%_installName%\sessions\autosave.win" ( | |
set sessionFile=%appdata%\Opera\%_installName%\sessions\autosave.win | |
) else ( | |
set sessionFile=%appdata%\Opera\%_installName%\profile\sessions\autosave.win | |
) |
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
Opera Preferences version 2.1 | |
; Do not edit this file while Opera is running | |
; This file is stored in UTF-8 encoding | |
[User prefs] | |
Title=Opera Private mode | |
Opera Directory=C:\DOCUME~1\FRED~1.LAN\LOCALS~1\Temp\delete-me.1367 | |
Opera Local Directory=C:\DOCUME~1\FRED~1.LAN\LOCALS~1\Temp\delete-me.1367 | |
Show Default Browser Dialog=0 | |
Enable Usage Statistics=0 |
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(doc, forEach) { | |
var selectNodes = doc.selectNodes || function(xpath, resolver) { // for firefox | |
var contextNode = this.ownerDocument || this, out = [], i = 0, node | |
,nodes = contextNode.evaluate(xpath, contextNode, resolver || null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
for ( ; node = nodes.snapshotItem(i); i++) { | |
out.push(node); | |
} | |
return out; | |
}, length = 0, time, count = 0; | |
function duration(secs) { |
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
//! ==UserScript== | |
//! @include http://* | |
//! ==/UserScript== | |
(function(slice, toString, filter) { | |
// opera bug - DSK-259939 | |
var buggy = filter.call('fPaAiSlS', function(c) { return 'fail'.indexOf(c) == -1; }).join('') != 'PASS'; | |
function addGenerics(klass, methods) { | |
var fn; |
OlderNewer