- 1
- 2
https://habr.com/ru/post/449368/
Ко-ко-ко-ко-ко-кой багор )))
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
https://habr.com/ru/post/449368/
Ко-ко-ко-ко-ко-кой багор )))
−1
function isSpam(comment) {
// quick and dirty filter agains guest spam
// it can reject normal links, but who cares...
if ((comment.user_id == 1) && comment.text.match('http://'))
return true;
if ((comment.user_id == 25580) && ((comment.text.match('^, http')) ||
(comment.text.match(', , http')) ||
(comment.text.match('<strong>')) ||
(comment.text.match('^<a href=')) ||
(comment.text.match('^comment[0-9]+,')) ||
(comment.text.match('storefocus')) ||
(comment.text.match('.*Хрюкни, свинособака')) ||
(comment.text.match('.*<span style')) ||
(comment.text.replace(/\s*/g, '').match('viagra|cialis|levitra')) ||
(comment.text.match('-[0-9a-fA-F]{4}\.pdf'))))
return true;
return false;
}
http://gcode.cx/ngk/#!/settings
Какой анскилл )))
+1
else {
// на всякий случай возвращаем true в случае некоторых экзотических браузеров
flashinstalled = true;
}
return flashinstalled;
https://csdrop.org/
main.js
Просто из за комментария ☺
−2
Веб Программирование - это такая хуйня.
0
$('.checkboxwrap').on('mousedown',e => {
if($(e.target)[0].tagName == 'LABEL' && $(e.target).children('input').prop('checked') || $(e.target)[0].tagName == 'INPUT' && $(e.target).prop('checked')){
conf($(e.target));
} else {
console.log(12)
}
});
function conf(e){
let check = confirm('Точно?'),
input = $('.checkboxwrap input');
if(e[0].tagName == 'LABEL'){
if(check) {
input.eq($('label').index(e)).prop('checked',false);
console.log(13)
} else {
input.eq($('label').index(e)).prop('checked',true);
}
}
else{
if(check) {
input.eq($('input').index(e)).prop('checked',false);
console.log(14)
} else {
input.eq($('input').index(e)).prop('checked',true);
}
}
}
Автор скрипта написал, что не во всех браузерах работает... наверно ожидал, что ещё добавят!
А тут...
$(".checkbox").on("change", ({ target }) => {
if(!target.checked)
target.checked = !confirm('Точно?');
});
<label class="checkboxwrap">
<input type="checkbox" class="checkbox">
Husband
</label>
+2
<script>
qqq = 0;
setInterval(function(){
qqq++;
if ( qqq == 1 ) $('.qqq').text('.');
else if ( qqq == 2 ) $('.qqq').text('..');
else if ( qqq == 3 ) $('.qqq').text('...');
else {
$('.qqq').empty();
qqq = 0;
}
},900);
</script>
Многоточия...
Встретил случайно в одном из сайтов)
+1
// http://pacipfs2.antizapret.prostovpn.org/proxy-ssl.js
function FindProxyForURL(url, host) {
if (d_ipaddr.length < 10) return "DIRECT"; // list is broken
if (!az_initialized) {
var prev_ipval = 0;
for (var i = 0; i < d_ipaddr.length; i++) {
d_ipaddr[i] = parseInt(d_ipaddr[i], 36) + prev_ipval;
prev_ipval = d_ipaddr[i];
}
for (var i = 0; i < special.length; i++) {
special[i][1] = nmfc(special[i][1]);
}
az_initialized = 1;
}
var shost;
if (/\.(ru|co|cu|com|info|net|org|gov|edu|int|mil|biz|pp|ne|msk|spb|nnov|od|in|ho|cc|dn|i|tut|v|dp|sl|ddns|dyndns|livejournal|herokuapp|azurewebsites|cloudfront|ucoz|3dn|nov|linode|amazonaws|sl-reverse|kiev)\.[^.]+$/.test(host))
shost = host.replace(/(.+)\.([^.]+\.[^.]+\.[^.]+$)/, "$2");
else
shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, "$2");
// Script optimization, see https://bugs.chromium.org/p/chromium/issues/detail?id=678022
for (var k in dn) {
var r = new RegExp('\\.'+k+'$');
if (r.test(shost)) {shost = shost.replace(r, dn[k]); break;}
}
var curarr;
if (/^[a-d]/.test(shost)) curarr = d_ad;
else if (/^[e-h]/.test(shost)) curarr = d_eh;
else if (/^[i-l]/.test(shost)) curarr = d_il;
else if (/^[m-p]/.test(shost)) curarr = d_mp;
else if (/^[q-t]/.test(shost)) curarr = d_qt;
else if (/^[u-z]/.test(shost)) curarr = d_uz;
else curarr = d_other;
var oip = dnsResolve(host);
var iphex = "";
if (oip) {
iphex = oip.toString().split(".");
iphex = parseInt(iphex[3]) + parseInt(iphex[2])*256 + parseInt(iphex[1])*65536 + parseInt(iphex[0])*16777216;
}
var yip = 0;
if (iphex) {
for (var i = 0; i < d_ipaddr.length; i++) {
if (iphex === d_ipaddr[i]) {yip = 1; break;}
}
}
for (var i = 0; i < curarr.length; i++) {
if (yip === 1 || shost === curarr[i]) {
return "HTTPS proxy.antizapret.prostovpn.org:3143; PROXY proxy.antizapret.prostovpn.org:3128; DIRECT";
}
}
for (var i = 0; i < special.length; i++) {
if (isInNet(oip, special[i][0], special[i][1])) {return "PROXY CCAHIHA.antizapret.prostovpn.org:3128; DIRECT;";}
}
return "DIRECT";
}
CCAHIHA
0
var text_message = "";
text_message += "\n Вопрос №1: " + $('input[name=question_0]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_0]:checked').val();
text_message += "\n Вопрос №2: " + $('input[name=question_1]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_1]:checked').val();
text_message += "\n Вопрос №3: " + $('input[name=question_2]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_2]:checked').val();
text_message += "\n Вопрос №4: " + $('input[name=question_3]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_3]:checked').val();
text_message += "\n Вопрос №5: " + $('input[name=question_4]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_4]:checked').val();
text_message += "\n Вопрос №6: " + $('input[name=question_5]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_5]:checked').val();
ууууиииииии
0
var normalWidth = 1440 + 20;
var maxStep = 720;
var eDivSizeWidth = 1440;
var eDivBodyEndWidth = 1400;
var eSearchInputWidth = 920;
var eSearchButtonLeft = 1210;
var eCartButtonLeft = 1260;
function onWindowResize()
{
var step = normalWidth - innerWidth;
if (step < 0)
step = 0;
else if (step > maxStep)
step = maxStep;
document.getElementById('divSize').style.width = eDivSizeWidth - step;
document.getElementById('divBody').style.width = eDivBodyEndWidth - step;
document.getElementById('divEnd').style.width = eDivBodyEndWidth - step;
document.getElementById('mainSearch').style.width = eSearchInputWidth - step;
document.getElementById('searchButton').style.left = eSearchButtonLeft - step;
document.getElementById('cartButton').style.left = eCartButtonLeft - step;
}
window.onresize = function() { onWindowResize(); };
window.onload = function() { onWindowResize(); };
0
$(`.js-filter-panel__radio__pre-tuned-up-settings`).find(`.js-filter-reg-date-radio-item:not(#${$input.attr(this._preTunedSelectedPeriod)})`).prop('checked', false);