- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
/* Функция загрузки модулей */
function load ($name, $path, $cfg = array()) {
require($path.'/'.$name.'.php');
if($cfg !== null) {
return new $name($cfg);
} else {
return new $name;
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
/* Функция загрузки модулей */
function load ($name, $path, $cfg = array()) {
require($path.'/'.$name.'.php');
if($cfg !== null) {
return new $name($cfg);
} else {
return new $name;
}
}
Хмм, что-то тут не так.
−1
protected void ASPxUploadControl1_FilesUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FilesUploadCompleteEventArgs e)
{
if (Request.Cookies["LID"] != null)
{
int ListId = Convert.ToInt32(Request.Cookies["LID"].Value);
Response.Cookies["LID"].Expires = DateTime.Now.AddDays(-1);
foreach (DevExpress.Web.ASPxUploadControl.UploadedFile uf in ASPxUploadControl1.UploadedFiles)
{
uf.SaveAs(@"C:\TEMP\ListUploads\" + uf.FileName, true);
ListInfo.ImportList(Convert.ToInt16(ListId), @"C:\TEMP\ListUploads\" + uf.FileName);
}
}
}
блять, это же каким инвалидом надо быть, чтобы так сделать загрузку файла в базу?
0
if @SubDepartmentID = 0 set @SubDepartmentID = null
if @QuoteID = 0 set @QuoteID = null
if @PartnerID = 0 set @PartnerID = null
if @QuoteID = 0 set @QuoteID = null
if @SubDepartmentID = 0 set @SubDepartmentID = null
это кусок хранимой процедуры
+3
// eval both the numbers to remove quotes
// otherwise 4 + 5 will be "4" + "5" which in JS will equal 45
evalDisplay = eval(displayNum),
evalStored = eval(storedNum);
Гениальный способ получить число из строки (вместо evalDisplay = +evalDisplay)
−1
dHA2aElMSFRWMXhQSlVJRUFvSWdHcXlsSG40anlrWko0eG5BMHl5R2lKUUp0CnV4WEVaYU5WNEtZ
YWVJSWJMbHNXZVlqOHE4QWp6RzVnNWJJS040aklFVjJjdEVFT2k1dDhiRnY5WHZka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
d0lvdVlxa2pFR0lWbVYvUWRhWFkKeTRWTVM5cjd3VThEOE5CK3F1RlEvNGZiNXJIUStQeGNDMDIz
NWJCek54dHhsTlQ5VVloc0V5bFQ0clVVc3pEdgpQR3NGYzRLVFFnRXFaalE1eVBwUWx5b1pldXJj
b29JcVdOb3FtdFk2MDFCU2p0VUc2Wlo1M2NIa3d1aWdDb3NiCm96Q3JhVU5UTVlpaGpnOGk0bmtB
bE5sTzJLUDVWdCtQemtGNXVyM0tCdkRUNHc2OHN1WDBzaG1pNC9tNWI0V3EKc3Boa0FTYlkxVlg4
Zk51SkswSktNZ3puZHNTeEMzd01FV1VEaDNNcDJrUU55WkxWbVZDTEY1WjZnTmI3OGRJagpBSzJK
ZVhLakI0SFdLN3dVejBuUklIQzhQTjJVZ1B5ZXRaM2l0R1VZVVBVM21TM01SdDdwVlJyVUx6SnpP
0
def self.allowed_symbols
@allowed_symbols ||= (('A'..'Z').to_a + (0..9).to_a).shuffle
end
def self.forbidden_symbols_regexp
@allowed_symbols_regexp ||= Regexp.new("[^#{allowed_symbols.join}]")
end
Проверка формата промокода
0
// oldman and pilul
$( "#draggable" ).draggable();
$( "#draggable1" ).draggable();
$( "#droppable" ).droppable({
drop: function() {
$("#droppable").attr("src","img/happy1.png");
$("#droppable1").attr("src","img/happy1.png");
$('#draggable').hide();
$('#draggable1').hide();
}
});
//buttons
$('#weekbtn').click(function(){
if ( $('#weekbtn').attr("src")== "img/week-pushed-button.png" ) {
$("#weekbtn").attr("src","img/week-button.png");
$("#weekbtn1").attr("src","img/week-button.png");
} else {
$("#weekbtn").attr("src","img/week-pushed-button.png");
$("#weekbtn1").attr("src","img/week-pushed-button.png");
}
});
$('#daybtn').click(function(){
if ( $('#daybtn').attr("src")== "img/day-pushed-button.png" ) {
$("#daybtn").attr("src","img/day-button.png");
$("#daybtn1").attr("src","img/day-button.png");
} else {
$("#daybtn").attr("src","img/day-pushed-button.png");
$("#daybtn1").attr("src","img/day-pushed-button.png");
}
});
$('#mounthbtn').click(function(){
if ( $('#mounthbtn').attr("src")== "img/mounth-pushed-button.png" ) {
$("#mounthbtn").attr("src","img/mounth-button.png");
$("#mounthbtn1").attr("src","img/mounth-button.png");
} else {
$("#mounthbtn").attr("src","img/mounth-pushed-button.png");
$("#mounthbtn1").attr("src","img/mounth-pushed-button.png");
}
});
//roller
function move(){
var rng = document.getElementById('scrol-line'),
rng1 = document.getElementById('scrol-line1'),
roll = document.getElementById('bgc'),
roll1 = document.getElementById('bgc1');
roll.value = rng.value;
rng1.value = rng.value;
roll1.value = rng1.value;
}
//slider
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("sliders");
if (n > slides.length) {
slideIndex = 1
}
if (n < 1) {
slideIndex = slides.length
}
for (i=0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[slideIndex-1].style.display = "block";
}
+1
рсДополнительныеСведения = РегистрыСведений.ДополнительныеСведения.СоздатьНаборЗаписей();
СвойствоУведомление = рсДополнительныеСведения.Добавить();
СвойствоУведомление.Объект = ЭтотОбъект.Ссылка;
СвойствоУведомление.Свойство = ДопСведение;
СвойствоУведомление.Значение = Истина;
рсДополнительныеСведения.Записать();
Код одних франчей.
причем все ж по ТЗ)) запись записалась? записалась! И побоку, что остальные записи при этом снесли нах)))
0
long func_strtol(char *p , char **cpyar , int type ){
long int result = 0, stp = 0, t = 0,step = 0, integer = 0, sign = 1;
if (*p == 45 ){
sign = -1;
step++;
}
else if(*p == 43){
step++;
}
if (!type ){
type = 10;
}
if( type >= 0 && type <= 10 ) {
while ( isdigit( p[step])) {
step++;
}
}
else if( type >= 11 && type <= 36 ) {
while( (p[step ] - 55 <= ( type - 1 ) && isalpha( p[step] ) ||
(p[step ] - 87 <= ( type - 1) && isalpha( p[step] ) ||
isdigit( p[step])
) ) ) {
step++;
}
}
stp = step - 1;
while( isalpha( p[stp] ) || isdigit( p[stp] )){
if( isalpha( p[stp] ) ){
integer += p[stp] >= 97 ? (p[stp] - 87) * pow(type,t) : (p[stp] - 55) * pow(type,t);
}
else if((p[stp] - 48 ) < type ){
integer += (p[stp] - 48) * pow( type, t );
}
stp--;
t++;
}
*cpyar = step == 1 && *p == '-' ? &p[step - 1]: &p[step];
result = (integer ) * sign;
return result ;
}
Пойду почитаю "День Опричника"
+2
$(document).ready(function(){
$('.field').click(function(){
$('.selected').removeClass('selected');
$(this).addClass('selected');
$(this).click(function(){
$('#move').attr('disabled', true);
$('.selected, .field').removeClass('visible');
$('.field').text('');
$('.selected').html('<span id="user"><img src="user.gif"></span>');
$('.selected').next().addClass('visible');
$('.selected').next().next().next().next().next().next().addClass('visible');
$('.selected').next().next().next().next().next().next().next().addClass('visible');
$('.selected').next().next().next().next().next().next().next().next().addClass('visible');
//$('.selected').addClass('visible');
$('.selected').prev().addClass('visible');
$('.selected').prev().prev().prev().prev().prev().prev().addClass('visible');
$('.selected').prev().prev().prev().prev().prev().prev().prev().addClass('visible');
$('.selected').prev().prev().prev().prev().prev().prev().prev().prev().addClass('visible');
});
...
Поле перемещения, написано около года назад :D не знал как можно по-другому