Skip to content

Instantly share code, notes, and snippets.

opera.addEventListener('BeforeScript', function(e) {
if ( /apple_core/.test(e.element.src) ) {
e.element.text = e.element.text.replace( /g.replace\(\/\[\\'\\"\\.+\n/, 'g.replace(/[\\\'\\\"“”‘’]/g,"")' );
}
}, false );
if (location.hostname === 'www.jma.go.jp' ) {
opera.addEventListener(
'BeforeScript', function(e) {
if ( /hisjs\/OptAmedas.js/.test(e.element.src) ) {
e.element.text = e.element.text.replace( /rtnDate\s=\siMonth\s\+/, 'rtnDate+=iMonth;rtnDate+=' );
}
}, false );
}
// ==UserScript==
// @name Fix content type
// @author t.ashula
// @namespace http://ashula.info/
// ==/UserScript==
(function(){
window.addEventListener( 'load', function () {
var flooding = function( d ){ return ( d.getElementsByTagName( 'head' )[ 0 ].children.length === 0 ); };
var binarray = function( d ){
opera.addEventListener('BeforeExternalScript', function(e){
if ( e.element.src.match(/minmax.js/) ) {
e.preventDefault();
}
}, false);
// Opera userjs patch for TI
// http://focus.ti.com/js/shared/metrics/metrics-min.js
// original : /^(.*\.)*(.*\.[a-z]{2,3}\.[a-z]{2})$/i
// fix : /^([^.]*\.)*(.*\.[a-z]{2,3}\.[a-z]{2})$/i
(function () {
if (location.hostname.match(/\.tij?\.co./) ) {
opera.addEventListener('BeforeScript', function (e) {
if (/metrics(-min)?.js/.test(e.element.src)) {
e.element.text = e.element.text.replace(
/\/\^\(\.\*\\\.\)\*\(\.\*\\\.\[a-z\]\{2,3\}\\\.\[a-z\]\{2\}\)\$\//,
diff --git a/src/conversions.h b/src/conversions.h
index e654cc9..045837f 100644
--- a/src/conversions.h
+++ b/src/conversions.h
@@ -252,7 +252,7 @@ inline double StringToDouble(Iter it, Iter last, bool parse_float) {
return (parse_float && !is_found_zero) ? Conversions::kNaN : 0;
} else {
buffer[pos++] = '\0';
- return std::strtod(buffer.data(), NULL);
+ return std::atof( buffer.data() ); //return std::strtod(buffer.data(), NULL);
(function (u) {
if (location.hostname.match(/moshidora-movie.jp/) ) {
document.attachEvent = u;
}
})();
// ==UserScript==
// @name Amazon Advanced.
// @namespace http://ashula.info/
// @include http://www.amazon.co.jp/*
// @version 0.0.1
// ==/UserScript==
(function(W,D){
function bought(e){
var st = D.querySelector('#searchTemplate');
(function(w,l){
//return;
var excludes = ['google.com'].join('|');
var trusted = ['dragonfly.opera.com','bit.ly','delicious.com','www.google.co.jp','gyazo.com','delicious.com','google.com','lingr.com','www.w3.org','ashula.info','fastladder.com','www.opera.com','opera-users.jp','puchi.co','oflo.in','ofton.in','opera-wiki.com','localhost','browser-festa.jp'
].join('|');
if ( !l.protocol.match(/http/)
|| ( w.parent !== w )
|| ( l.hostname.match(new RegExp('(' + excludes + ')$' )))
|| ( l.hostname.match(new RegExp('(' + trusted + ')$' )))
){
@t-ashula
t-ashula / 0.js
Created April 27, 2011 13:04
userjs xss filter prototype
// 0.js xss filter as userjs
(function( w, d ){
var _wl = w.location,
_wdu = w.decodeURI,
_wduc = w.decodeURIComponent,
_dl = d.location,
_dw = d.write,
_as = Array.prototype.slice;