function atoi(charstring)
{
  if(charstring=="a") return 0x61;if(charstring=="b") return 0x62;
  if(charstring=="c") return 0x63;if(charstring=="d") return 0x64;
  if(charstring=="e") return 0x65;if(charstring=="f") return 0x66;
  if(charstring=="g") return 0x67;if(charstring=="h") return 0x68;
  if(charstring=="i") return 0x69;if(charstring=="j") return 0x6a;
  if(charstring=="k") return 0x6b;if(charstring=="l") return 0x6c;
  if(charstring=="m") return 0x6d;if(charstring=="n") return 0x6e;
  if(charstring=="o") return 0x6f;if(charstring=="p") return 0x70;
  if(charstring=="q") return 0x71;if(charstring=="r") return 0x72;
  if(charstring=="s") return 0x73;if(charstring=="t") return 0x74;
  if(charstring=="u") return 0x75;if(charstring=="v") return 0x76;
  if(charstring=="w") return 0x77;if(charstring=="x") return 0x78;
  if(charstring=="y") return 0x79;if(charstring=="z") return 0x7a;
  if(charstring=="0") return 0x30;if(charstring=="1") return 0x31;
  if(charstring=="2") return 0x32;if(charstring=="3") return 0x33;
  if(charstring=="4") return 0x34;if(charstring=="5") return 0x35;
  if(charstring=="6") return 0x36;if(charstring=="7") return 0x37;
  if(charstring=="8") return 0x38;if(charstring=="9") return 0x39;
  if(charstring==".") return 0x2e;
  return 0x20;
}

found in a proxy script

By Anonymous, 2020-08-10 03:17:52
$("#search-submit").click(function() {
  $("#search form").submit()
});

type="submit" is too mainstream, jquery is the proper way to do it

By Kadet, 2016-02-13 16:44:10
function isEmpty(value) {
    if (value === '') {
        return false;
    } else if (value === 0) {
        return false;
    } else if (value === null) {
        return false;
    } else if (value === undefined) {
        return false;
    } else {
        return true;
    }
    return true;
}

javascript empty value check

By mr.js, 2017-12-13 11:43:20
if(date.getFullYear() <= 2017) {
    if(date.getMonth() <= 11) {
        if(date.getDate() <= 26) {
            if(date.getHours() <= 23) {
                if(date.getMinutes() <= 59) {
                    if(date.getSeconds() <= 59) {
                        //Display popup before 2017-11-27
                    }
                }
            }
        }
    }
}

    
By Anonymous, 2017-12-12 14:14:55
    function changePassword() {
        if (isInputEmpty()) {
            $.ajax({
                type: 'POST',
                data: '...'
                url: '...',
                success: function (result) {
                    if (result.substring(0, 3) != "!!!") {
                        //success
                    } else {
                        //faliure
                    }
                },
                error: function () {
                    }
            });
        }
    }

And of course,in production, it always reported success and never changed the password, because of equally bad server code.

By You will be proud of our code!, 2017-12-15 11:30:02
let arr = []
if(arr[record.id]) {
    arr[record.id] = false
} else {
    arr[record.id] = false
}
this.setState({a: arr})
arr = []
By Anonymous, 2021-12-27 06:55:59
var i = 0

for (var n in array) { 
    i+=1
    // ...
}
By PureJavascript, 2023-02-11 11:08:33
else if result !== true && result === false { return result !== true }

should I keep this in our project or nah

By codelord, 2022-06-20 16:43:54
var lightBox_ReplaceSelectsWithSpans = function()
{
	var selects = document.getElementsByTagName('select');
	for (var i = 0; i < selects.length; i++) {
		var select = selects[i];
		if (select.clientWidth == 0 || select.clientHeight == 0 || 
			select.nextSibling == null || select.nextSibling.className == 'selectReplacement') {
			continue;
		}
			
		var span = document.createElement('span');
		// this would be "- 3", but for that appears to shift the block that contains the span 
		//   one pixel down; instead we tolerate the span being 1px shorter than the select
		span.style.height = (select.clientHeight - 4) + 'px';
		span.style.width = (select.clientWidth - 6) + 'px';
		span.style.display = 'inline-block';
		span.style.border = '1px solid rgb(200, 210, 230)';
		span.style.padding = '1px 0 0 4px';
		span.style.fontFamily = 'Arial';
		span.style.fontSize = 'smaller';
		span.style.position = 'relative';
		span.style.top = '1px';
		span.className = 'selectReplacement';
		
		span.innerHTML = select.options[select.selectedIndex].innerHTML ;//+ 
			//'<img src="custom_drop.gif" alt="drop down" style="position: absolute; right: 1px; top: 1px;" />';
		
		select.cachedDisplay = select.style.display;
		select.style.display = 'none';
		select.parentNode.insertBefore(span, select.nextSibling);
	}
};
By Anonymous, 2023-03-29 16:59:15
 public void updateCurrency() {
        LOGGER.info("Update currencies");
        var ok = false;

        try {
            getExchangeRatesMechanism(getExchangeRatesProcessor());
            ok = true;
        } catch (Exception exception) {
            LOGGER.error(exception.getMessage(), exception);
        }

        if (ok) {
            LOGGER.info("The currencies were updated successfully!");
        }
    }
By halogenUnit, 2022-09-29 13:31:58
> var x = 3;
> '5' + x - x
50
> '5' - x + x
5 // Because fuck math

JS is simply. Oh, wait...

By mademan, 2015-11-18 13:50:39
function urlREPLACER(dtTEXTVALUE){
    
    dtTEXTVALUE.indexOf('http://') != -1 && (dtTEXTVALUE = dtTEXTVALUE.replace('http://','')) && dtTEXTVALUE.indexOf('.aspx') == -1 && (dtTEXTVALUE += '.aspx');
    
    return dtTEXTVALUE;
}
By I'm glad, 2019-02-16 13:10:54
$('#userCheck').not(this).prop('checked', false);
By Anonymous, 2019-04-17 10:54:22
form = JSON.parse(JSON.stringify(this.mobilityDistanceForm.getRawValue()));
By tralaladidou, 2019-07-15 20:41:51
if (currentDay.day() !== MONDAY) {
    do {
        currentDay = this.$moment(currentDay).subtract(1, 'days');
        days.unshift(currentDay);
    } while (currentDay.day() !== MONDAY);
}
By Anonymous, 2017-10-14 18:44:20