- 1
- 2
- 3
- 4
- 5
- 6
- 7
for (var i = 0; i < Collection.Count(); i++)
{
if (i==x)
{
Collection.Remove(i);
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+124
for (var i = 0; i < Collection.Count(); i++)
{
if (i==x)
{
Collection.Remove(i);
}
}
Классика
+145
$(function() {
// hardcore mode
"use strict";
"use paranoid";
// todo: string-to-functioName converter and more flexible injector
;(function() {
var ooStack = {
writeback: function() {
// main wrappers
var wrappers = $( 'html, body' );
var meta = $( 'head' );
var root = $( '#core' , wrappers );
var head = $( '#head', root );
var content = $( '#content' , root );
var sidebar = $( 'aside' , root );
var articles = $( 'article' , content );
// it can fuck your brain
var footway = {
root: root,
head: head,
content: content,
sidebar: sidebar,
articles: articles,
wrappers: wrappers,
// paginator
paginator: $( '.pager' , root ),
};
// return stack definition
return footway;
}
};
// New world
var appInstance = new world();
// Inject selectrors and methods
var app = appInstance.application;
app.dom = ooStack.writeback();
// Execute
app.init();
})();
});
Распедаль мои копыта -- наебнись мозги козла :D В Оригинале : робоцып, робокоп head и лопата
+147
getOffsetPosition: function( self, hash ) {
return $( '#' + hash, self.dom.root ).offset().top - 0;
},
// 27 is a magic fix number :: +5
getNumFromStrPx: function( pixels ) {
return ( pixels.replace( 'px' , '' ) - 0 ) - 22;
},
Magic Mashrooms ;) 1200 mics => non stop and sound sucks
+146
var passedLinks = new Array();
for( var lnk = 0; lnk <= aLinksCollection.length; lnk++ ) {
var AJAXLink = aLinksCollection[ lnk ];
// exclusions by DOM objects, filter external links and shuffle some extensions
if( typeof AJAXLink === 'undefined' ) continue;
var aLoc = AJAXLink.href;
if( AJAXLink.host.match( document.location.host ) &&
!self.filters.extensions.test( AJAXLink.pathname ) &&
!aLoc.match( self.filters.pathways[0] ) ) {
passedLinks.push( AJAXLink );
};
};
/* regExps constants */
filters: {
extensions: /\.(gif|jpg|jpeg|tiff|png|exe|pdf|txt|psd|rss|rdf|cpgz|tar\.gz|rar|zip|html|htm|test|tar|xml|msi|iso|swf)$/i,
trapzones: '#id1, #id2, #id3, .class1 pre:last, tags p:last',
pathways: [
'edit|add|reply|search|rss\.xml|#',
'contact|license|about|advertisement'
]
},
Выложу сам лучше ... отобрать хотели и сделать тоже самое ;) не серчайте
+146
$( self.filters.trapzones ).hover(function() {
if( garbage && !garbage.match(similar.id) ) {
$.Storage.set('SimNodes', garbage + similar.id + '*');
$('#similar').delay(550).show(550);
}
if( !garbage ) {
$.Storage.set('SimNodes', '0*' + similar.id + '*');
$('#similar').delay(550).show(550);
}
});
String Mach db
+147
function uri_fix($url) {
/* clean protocols & prefixes */
$url = str_replace('https://', '', $url);
$url = str_replace('http://', '', $url);
$url = str_replace('ftp://', '', $url);
$url = str_replace('www.', '', $url);
/* clean all bad simbols : explode in two steps & check domain level, return only clear second level domain */
$url = explode('/', $url);
$url = preg_replace('/[^a-zа-я0-9-.]+/is', '', $url[0]);
$status = 'L1';
$domainLevel = explode('.', $url);
if ( !isset($domainLevel[3]) ) {
if ( isset($domainLevel[2]) ) {
$url = $domainLevel[1] . '.' . $domainLevel[2];
$status = 'L2';
}
} else {
$status = 'ERR';
}
$domainStatus = array('DOMAIN', $url, 'www.' . $url, $status);
return $domainStatus;
}
сабж
+148
function proton_username( $object ) {
if( $object->uid && $object->name ) {
$name = ( drupal_strlen( $object->name ) > 20 ) ? drupal_substr( $object->name, 0, 15 ) . '...' : $object->name;
$output = ( user_access( 'access user profiles' ) ) ? l( $name, 'pathTo/'. $object->uid, array() ) : ( ( $name === 'HideMe' ) ? '<a title="myNameIsNotAname" href="/pathTo" rel="hiddenMan">Fake Face</a>' : check_plain( $name ) );
}
Защита личной жизни
+154
$birthDate = "".($_POST['birthday'])."";
//explode the date to get month, day and year
$birthDate = explode("/", $birthDate);
//get age from date or birthdate
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md") ? ((date("Y")-$birthDate[2])-1):(date("Y")-$birthDate[2]));
узнайСвойВозраст,%userName%
+145
status = array();
if ( !empty( $_POST['token'] ) && $_POST['token'] !== 'www.zencoder.pro::mailDrop' ) exit(0);
$email = '[email protected]';
$sender = ( !empty( $_POST['sender'] ) && preg_match('/[^@]+\@[^\.]+\.[a-z]{2,4}/i', $_POST['sender']) ) ? text_check( $_POST['sender'] ) : false;
if( !$email ) {
$status[] = array(
'txt' => 'проверьте поле email',
'field_id' => '#recepient',
);
}
echo json_encode( $status );
неДрисо-ориентированное программирование нарушившее заветы долбоебов, на которых дрису похуй
+144
(function() {
var appBase = function( appId ) {
appId = appId || Math.floor( Math.random() * ( 1000 - 1 ) + 1 );
this.stack = {
methods: [ ], extends: { },
init: function( cfg ) {
this.creator( cfg );
this.bootstrap();
},
bootstrap: function() {
this.methods.init = null;
var param = new Object();
param.app = this.methods,
param.opt = this.setup;
param.__proto__ = null;
for( var i in this.setup.inits ) {
this.methods[ this.setup.inits[i] ].apply( param );
};
},
creator: function( cfg ) {
for( var mtd in cfg ) {
var flag = cfg[ mtd ].options[ 1 ] || null,
name = cfg[ mtd ].options[ 0 ] + "",
func = cfg[ mtd ].func;
this.methods[ name ] = func;
this.methods[ name ].name = name;
if( flag ) {
flag = flag.split('|');
if( flag[0] ) {
switch( flag[0] ) {
case 'init': this.setup.inits.push( name ); break;
case 'defer':
this.setup.defer.push( name );
this.setupTimer( [ flag[ 1 ], name, flag[ 2 ] - 0 ] );
break;
};
};
};
};
},
setupTimer: function( opt ) {
var tf = this.setup.timer[ opt[1] ],
tt = this.methods[ opt[1] ],
tm = opt[ 2 ] || 500;
switch( opt[0] ) {
case 'interval': tf = setInterval( tt, tm ); break;
case 'timeout': tf = setTimeout( tt, tm ); break;
};
},
flushTimer: function( id ) {
clearInterval( this.setup.defer[ id ] );
console.log( 'Interval '+ id +' Stoped!');
},
setup: {
appId: 'BiO Kernel' + appId, param: [ ], inits: [ ], defer: [ ],timer: [ ], flags: { }
}
};
this.stack.__proto__ = null; this.__proto__ = null;
};
var application = new appBase();
var app = application.stack;
var cfg = [
{
func: function() {
console.log( 'RUN [mtd_1] AT [init stage] => force [mtd_3]' );
this.app['mtd_3'].apply(this);
},
options: [ 'mtd_1' , 'init' ]
},
{
func: function() {
console.log( 'RUN [mtd_2] AT [init stage]' );
},
options: [ 'mtd_2' , 'init' ]
},
{
func: function() {
console.log( 'RUN [mtd_3] BY [mtd_1] FROM [init stage]' );
},
options: [ 'mtd_3' ]
},
{
func: function() {
console.log( 'run defered method #1 in timeout' );
},
options: [ 'deferedMethod_1', 'defer|timeout|8500' ]
},
{
func: function( ) {
console.log( 'run defered method #2 in interval' );
},
options: [ 'deferedMethod_2', 'defer|interval|500' ]
},
];
app.init( cfg, true );
})();
Съебаться из страны не получилось ): Оно не взламывалось вообще ... лимон так и не дали, а в жопу выебали через кого-то.