- 1
- 2
- 3
- 4
Когда написал залупу на крестах
https://pbs.twimg.com/media/EQNGt9QU4AABnd1?format=png&name=small
Именно поэтому я за Electron.js
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Когда написал залупу на крестах
https://pbs.twimg.com/media/EQNGt9QU4AABnd1?format=png&name=small
Именно поэтому я за Electron.js
+5
function fix_hacker_strings($str){
$s=$str;
$s=str_replace('/*', 'xx', $s);
$s=str_replace('*/', 'xx', $s);
$s=str_replace('../', 'xxx', $s);
$s=str_replace('..\\', 'xxx', $s);
$s=str_ireplace('file:', 'xxxxx', $s);
$s=str_ireplace(':$', 'xx', $s);
$s=str_ireplace('http:', 'xxxx', $s);
$s=str_ireplace('https:', 'xxxxx', $s);
$s=str_ireplace('script', 'xxxxxx', $s);
$s=str_ireplace('delete', 'xxxxxx', $s);
$s=str_ireplace('drop', 'xxxx', $s);
$s=str_ireplace('select', 'xxxxxx', $s);
$s=str_ireplace('update', 'xxxxxx', $s);
$s=str_ireplace('replace', 'xxxxxxx', $s);
$s=str_ireplace('/etc/', '/xxx/', $s);
$s=str_ireplace('/var/', '/xxx/', $s);
$s=str_ireplace('/root/', '/xxxx/', $s);
$s=str_ireplace('/bin/', '/xxx/', $s);
$s=str_ireplace('/usr/', '/xxx/', $s);
$s=str_ireplace('/sys/', '/xxx/', $s);
$s=str_ireplace('/sbin/', '/xxxx/', $s);
$s=str_ireplace('/proc/', '/xxxx/', $s);
$s=str_ireplace('/boot/', '/xxxx/', $s);
$s=str_ireplace('mysql', 'xxxxx', $s);
return $s;
}
обработка user input
−3
Приведите реальный пример программы на 1С
Вот прямо типичный пример задачи, где я должен взять именно 1С.
0
IT Оффтоп #31
#1: https://govnokod.ru/18142 https://govnokod.xyz/_18142
#2: https://govnokod.ru/18378 https://govnokod.xyz/_18378
#3: https://govnokod.ru/19667 https://govnokod.xyz/_19667
#4: https://govnokod.ru/21160 https://govnokod.xyz/_21160
#5: https://govnokod.ru/21772 https://govnokod.xyz/_21772
#6: https://govnokod.ru/24063 (потёр пидор сракер) https://govnokod.xyz/_24063
#7: https://govnokod.ru/24538 https://govnokod.xyz/_24538
#8: https://govnokod.ru/24815 (потёр пидор сракер) https://govnokod.xyz/_24815
#9: https://govnokod.ru/24867 https://govnokod.xyz/_24867
#10: https://govnokod.ru/25328 https://govnokod.xyz/_25328
#11: https://govnokod.xyz/_25436 https://govnokod.ru/25436 (потёр пидор сракер)
#12: https://govnokod.xyz/_25471
#13: https://govnokod.xyz/_25590 (потёр пидор сракер)
#14: https://govnokod.xyz/_25684
#15: https://govnokod.xyz/_25694
#16: https://govnokod.xyz/_25725
#17: https://govnokod.xyz/_25731
#18: https://govnokod.xyz/_25762
#19: https://govnokod.xyz/_25767
#20: https://govnokod.xyz/_25776
#21: https://govnokod.xyz/_25798
#22: https://govnokod.xyz/_25811
#23: https://govnokod.xyz/_25863
#24: https://govnokod.xyz/_25941
#25: https://govnokod.xyz/_26026
#26: https://govnokod.xyz/_26050
#27: https://govnokod.xyz/_26340
#28: https://govnokod.xyz/_26372
#29: https://govnokod.xyz/_26385
#30: https://govnokod.xyz/_26413
+3
onst addAdjacencies = (
nodes,
) => (
nodes
.map(({
colorId,
id,
x,
y,
}) => ({
color: colors[colorId],
eastId: (
getNodeAtLocation({
nodes,
x: x + 1,
y,
})
),
id,
northId: (
getNodeAtLocation({
nodes,
x,
y: y - 1,
})
),
southId: (
getNodeAtLocation({
nodes,
x,
y: y + 1,
})
),
westId: (
getNodeAtLocation({
nodes,
x: x - 1,
y,
})
),
}))
.map(({
color,
id,
eastId,
northId,
southId,
westId,
}) => ({
adjacentIds: (
[
eastId,
northId,
southId,
westId,
]
.filter((
adjacentId,
) => (
adjacentId !== undefined
))
),
color,
id,
}))
)
https://medium.com/free-code-camp/bet-you-cant-solve-this-google-interview-question-4a6e5a4dc8ee
джаваскриптер натужно пытается решить простейшую задачу "гугл уровня" с обходом, для увеличения кринжа прилагается поехавший кодстайл и решение на RxJS
0
Этот ебаный мир катицца в бездну.
Блять, бог, нажми уже F9!
0
PHP
print 3 --0-- 5 == 8; // Parse error
Java Script
console.log(3 --0-- 5 == 8); // Uncaught SyntaxError: Invalid left-hand side expression in postfix operation
Python
print(3 --0-- 5 == 8) // true
Именно поэтому я за "PHP" и "Java Script"
0
Гавно, вот нахуя ты удалило мой пост про бабушку и ишака?
Высеры гостя в упор не видишь, а мои трёшь... Нехорошо.
Провёл тебе залупой по губам, за такое деяние.
+4
if ($input->search_text!=""){
if ($input->search_text=="хуйня" or $input->search_text=="ХУЙНЯ" or $input->search_text=="Хуйня")
$this->result.="У нас серьезная компания и мы всякой хуйни на сайте не держим.";
else{
if (strlen($input->search_text)<2)
$this->result.="Строка поискового запроса должна состоять минимум из 2 символов.<br>Пожалуйста, измените Ваш запрос и повторите поиск.";
else{
$result.="Вы искали: <u><b>".$input->search_text."</b></u><br><br>";
Вот такие вот пасхалки у серьёзных компаний. И такой код.
+1
SET @from = 11836;
SET @to = 11840;
INSERT INTO `sprinter_catalog_tree` (
`sprinter_catalog_tree`.`level`,
`sprinter_catalog_tree`.`position`,
`sprinter_catalog_tree`.`parent_id`,
`sprinter_catalog_tree`.`catalog`,
`sprinter_catalog_tree`.`info_id`,
-- ...
)
SELECT
`sprinter_catalog_tree`.`level`,
`sprinter_catalog_tree`.`position`,
@to,
`sprinter_catalog_tree`.`catalog`,
`sprinter_catalog_tree`.`info_id`,
`sprinter_catalog_tree`.`format_id`,
`sprinter_catalog_tree`.`linked_id`,
`sprinter_catalog_tree`.`linked_shablon_id`,
-- ...
FROM `sprinter_catalog_tree` where parent_id = @from order by id;
INSERT INTO `sprinter_catalog_tree` (
`sprinter_catalog_tree`.`level`,
`sprinter_catalog_tree`.`position`,
`sprinter_catalog_tree`.`parent_id`,
`sprinter_catalog_tree`.`catalog`,
`sprinter_catalog_tree`.`info_id`,
-- ...
)
SELECT
a.`level`,
a.`position`,
(SELECT id from sprinter_catalog_tree as b where b.parent_id = @to and b.name like (SELECT name from sprinter_catalog_tree where id = a.parent_id)),
a.`catalog`,
a.`info_id`,
a.`format_id`,
a.`linked_id`,
a.`linked_shablon_id`,
-- ...
FROM `sprinter_catalog_tree` as a where parent_id in (SELECT id FROM sprinter_catalog_tree where parent_id = @from) order by id;
INSERT INTO `sprinter_catalog_info`
(`name`,
`eng_name`,
`text`,
-- ..
)
SELECT
`sprinter_catalog_info`.`name`,
`sprinter_catalog_info`.`eng_name`,
`sprinter_catalog_info`.`text`,
`sprinter_catalog_info`.`short_text`,
-- ...
FROM `sprinter_catalog_info` where id in (SELECT info_id from `sprinter_catalog_tree` where parent_id = @from or parent_id in (SELECT id from `sprinter_catalog_tree` where parent_id = @from));
CREATE temporary table if not exists ids
SELECT id from `sprinter_catalog_tree` where parent_id = @to or parent_id in (SELECT id from `sprinter_catalog_tree` where parent_id = @to);
UPDATE sprinter_catalog_tree as a SET info_id = (SELECT id from sprinter_catalog_info as b where a.name like b.name order by id desc limit 1) where a.id in (SELECT id from ids);
DROP table ids;
Высрал вот такое говно в качестве write-n-throw скрипта.
Дано: есть элементы дерева, хранящиеся в таблице sprinter_catalog_tree, связаны друг с другом через parent_id. Каждому из них соответствует указанный в info_id элемент таблицы sprinter_catalog_info.
Задача: скопировать все вложенные в раздел @from каталога элементы и его подразделы (вложенность не более 1 уровня) в раздел @to, так чтобы у них были новые id, и также скопировать соответствующие им sprinter_catalog_info. Скопированные sprinter_catalog_tree должны указывать на корректные sprinter_catalog_info, id которых заранее не известны.
Вот такое говно получилось, расскажите как надо было?