- 1
m_caster->HasAura(31866 || 31867 || 31868)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
m_caster->HasAura(31866 || 31867 || 31868)
из одного эмулятора WoW Cataclysm
+146
for ($i=0; $j<10; $k++)
ОЛОЛО С БАШОРГА
http://ithappens.ru/story/7621
+157
$(function () {
$("#tree_cat").jstree({
"html_data" : {
"data" : "<ul><li id='cat_41'><a href='/cat/41'>Продажа автомобилей, спецтехники, вело, мототехники, водной техники</a><ul><li id='cat_72'><a href='/cat/72'>Автомобили легковые новые</a></li></ul><ul><li id='cat_73'><a href='/cat/73'>Автомобили легковые подержанные</a></li>
....и т.д. ....
d='cat_146'><a href='/cat/146'>Автокредитование, лизинг</a><ul><li id='cat_147'><a href='/cat/147'>Автокредитование</a></li></ul><ul><li id='cat_148'><a href='/cat/148'>Лизинг автомобилей, техники</a></li></ul><ul><li id='cat_203'><a href='/cat/203'>Автоломбарды</a></li></ul></li></ul><ul><li id='cat_199'><a href='/cat/199'>Автострахование</a><ul><li id='cat_200'><a href='/cat/200'>Автострахование</a></li></ul></li></ul>"
},
......
if((node.attr("class") !== "jstree-open") && (node.attr("class") !== "jstree-closed") && (node.attr("class") !== "jstree-last jstree-closed")&& (node.attr("class") !== "jstree-last jstree-open")){
window.location = this+"#cat";
}
Ещё один эллитный питон программист....
+122
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
{
Color col = bmp.GetPixel(x, y);
col = Color.FromArgb((col.R + col.G + col.B) / 3,
(col.R + col.G + col.B) / 3,
(col.R + col.G + col.B) / 3);
int rValue = int.Parse(col.R.ToString());
html.Append(getGrayShade(rValue));
if (x == bmp.Width - 1)
html.Append("<br/&rt");
}
}
Нашел проект на codeproject, для конвертации изображения в аscii-art
+147
<?php
define ('SENGINES',serialize(
array(
'yandex',
'google',
// ... тут их еще несколько
)));
class <засекречено> {
/**
* engines
*
* @var array
*/
private $_engines = unserialize(SENGINES);
// ...
}
+162
<tbody>
<script type="application/json">
{
"remoteURL" : "/index.php?module=User&controller=Ajax_Group",
"saveState" : true,
"browseable":
{
"entriesTotal": {$amountGroups},
"entriesPage": {$itemsPerPage},
"activePage": {$activePage}
},
"columns":
{
"title":
{
"dataType": "string"
},
"description":
{
"dataType": "string"
}
},
"searchable":
{
"searchCols": [ "title", "description" ],
"activeSearch": "{addcslashes( $searchTerm, '"' )}",
"minSearchLength" : {$searchMinWordLength}
},
"sortable":
{
"sortCols": [ "title", "description" ],
"activeCol":
{
"column": "{$sortColumn}",
"sortDir" : "{$sortDirection}"
}
},
"clickable":
{
"defaultAction": [ "{Common_Image_Icon_Ajax::EDIT}" ]
}
}
</script>
{foreach $Groups as $Group}
{$group_id = $Group->getGroup_Id()}
<tr>
{if $rightToExport}
<td class="selector"><input type="checkbox" name="checkedGroups[]" value="{$group_id}"></td>
{/if}
<td>{$Group->escapeTitle()}</td>
<td>{$Group->escapeDescription()}</td>
{if $rightEdit || $rightDelete || $rightMail}
<td class="actions">
{Common_Image_Icon_Overlay::fetchIcon(Common_Image_Icon::EDIT, _( 'Edit' ), Common_Http_Query::fetch( ['module' => 'User', 'controller' => 'Overlay_Group', 'action' => 'edit', 'id' => $Group->getGroup_Id()] ))}
{if $rightDelete}
{$sql = "SELECT assessment_id FROM cobit_assessments WHERE usergroup_id = {$Group->getGroup_Id()} LIMIT 0,1"}
{$MySqlI = DatabaseConnector::getConnector()}
{$Result = $MySqlI->query( $sql )}
{if !( is_object( $Result ) and $Result->getNumRows() > 0 )}
{Common_Image_Icon_Ajax::fetchDelete( _( 'Delete' ), _( 'Do you really want to delete this Group?' ), Common_Http_Query::fetch( ['module' => 'User', 'controller' => 'Ajax_Group', 'action' => 'delete', 'id' => $Group->getGroup_Id()] ), $Group->getGroup_Id() )}
{else}
{Common_Image_Icon::fetchIcon(Common_Image_Icon::INFO, _("User Group is not deletable, because it is in use."))}
{/if}
{/if}
{if $rightMail}
{$sJavaScriptAction = Common_Event_Trigger_Overlay::fetch( Common_Event_Trigger_Overlay::OPEN, [ 'url' => "/index.php?module=User&controller=Overlay_Group&action=sendGroupMail&id={$Group->getGroup_Id()}"] )}
{Common_Image_Icon_Ajax::fetchIcon( Common_Image_Icon_Ajax::EMAIL, _('Send mail'), $sJavaScriptAction)}
{/if}
</td>
{/if}
</tr>
{/foreach}
</tbody>
Smarty Ajax SQL Table
Как все таки вставить SQL в Smarty.
+136
<div id="steklo">
<div class="sloy1">
<?php include ("modul/header_modul/header_modul.html") ?>
</div>
<?php include ("modul/rasdelitel/rasdelitel.html") ?>
<div class="sloy1">
<table id="absolut-content">
<tr>
<td>
<?php include ("modul/content_modul/content_modul.html") ?>
<div id="futer">футер</div>
</td>
</tr>
</table>
</div>
</div>
Обнаружил в проекте знакомого. Впечатлило. Теперь чувствую себя уютненько ^^ "Хорошо, хорошо... хорошо что у меня такого нету"
+74
public class test {
class Oper
{
int a, b, x,y;
int sum (int x) {
x = a+b;
return x;
}
int dif (int y)
{
y = a-b;
return y;
}
}
public static void main(String[] args)
{
Oper op = new Oper();
op.a = 6;
op.b = 7;
System.out.println("Сумма=" + op.sum());
System.out.println("Разность=" + op.dif());
}
+157
function ru_date($date) {
$ru_m = array("января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря");
$el = explode(".",$date);
for($i=0;$i<12;$i++) if($i+1==str_replace("0","", $el[1])) $el[1] = $ru_m[$i];
$date = implode(" ", $el);
return $date;
}
функция превращения даты вида 'd.m.Y' в 'd месяц Y'
+158
# Легкий XSS clean =)
$_GET = array_map('htmlspecialchars_array', $_GET);
Очень удивило...