- 1
- 2
fixed login dabl validation;
dabl ajax zaproses;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+123
fixed login dabl validation;
dabl ajax zaproses;
комментарий к коммиту
+130
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Centering div content in 2012 using CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style>
/* align horizontally */
.fu { width: 100%; text-align: center; }
/* align vertically */
@media all and (min-height:0px) { .fu { margin-top: 0px; }}
@media all and (min-height:2px) { .fu { margin-top: 1px; }}
@media all and (min-height:4px) { .fu { margin-top: 2px; }}
@media all and (min-height:6px) { .fu { margin-top: 3px; }}
@media all and (min-height:8px) { .fu { margin-top: 4px; }}
@media all and (min-height:10px) { .fu { margin-top: 5px; }}
@media all and (min-height:12px) { .fu { margin-top: 6px; }}
@media all and (min-height:14px) { .fu { margin-top: 7px; }}
@media all and (min-height:16px) { .fu { margin-top: 8px; }}
@media all and (min-height:18px) { .fu { margin-top: 9px; }}
@media all and (min-height:20px) { .fu { margin-top: 10px; }}
@media all and (min-height:22px) { .fu { margin-top: 11px; }}
.....
.....
.....
@media all and (min-height:1994px) { .fu { margin-top: 997px; }}
@media all and (min-height:1996px) { .fu { margin-top: 998px; }}
@media all and (min-height:1998px) { .fu { margin-top: 999px; }}
</style>
</head>
<body>
<div class="fu">horizontally and vertically centered</div>
</body>
</html>
Центрируем содержимое дива по горизонтали и вертикали :) http://jsfiddle.net/ykrBh/
+134
.events-bx-calendar .calendar-wrapper .calendar .days #day_1,
.events-bx-calendar .calendar-wrapper .calendar .days #day_2,
.events-bx-calendar .calendar-wrapper .calendar .days #day_3,
.events-bx-calendar .calendar-wrapper .calendar .days #day_4,
.events-bx-calendar .calendar-wrapper .calendar .days #day_5,
.events-bx-calendar .calendar-wrapper .calendar .days #day_6,
.events-bx-calendar .calendar-wrapper .calendar .days #day_7,
.events-bx-calendar .calendar-wrapper .calendar .days #day_8,
.events-bx-calendar .calendar-wrapper .calendar .days #day_9,
.events-bx-calendar .calendar-wrapper .calendar .days #day_10,
.events-bx-calendar .calendar-wrapper .calendar .days #day_11,
.events-bx-calendar .calendar-wrapper .calendar .days #day_12,
.events-bx-calendar .calendar-wrapper .calendar .days #day_13,
.events-bx-calendar .calendar-wrapper .calendar .days #day_14,
.events-bx-calendar .calendar-wrapper .calendar .days #day_15,
.events-bx-calendar .calendar-wrapper .calendar .days #day_16,
.events-bx-calendar .calendar-wrapper .calendar .days #day_17,
.events-bx-calendar .calendar-wrapper .calendar .days #day_18,
.events-bx-calendar .calendar-wrapper .calendar .days #day_19,
.events-bx-calendar .calendar-wrapper .calendar .days #day_20,
.events-bx-calendar .calendar-wrapper .calendar .days #day_21,
.events-bx-calendar .calendar-wrapper .calendar .days #day_22,
.events-bx-calendar .calendar-wrapper .calendar .days #day_23,
.events-bx-calendar .calendar-wrapper .calendar .days #day_24,
.events-bx-calendar .calendar-wrapper .calendar .days #day_25,
.events-bx-calendar .calendar-wrapper .calendar .days #day_26,
.events-bx-calendar .calendar-wrapper .calendar .days #day_27,
.events-bx-calendar .calendar-wrapper .calendar .days #day_28,
.events-bx-calendar .calendar-wrapper .calendar .days #day_29,
.events-bx-calendar .calendar-wrapper .calendar .days #day_30,
.events-bx-calendar .calendar-wrapper .calendar .days #day_31 { padding: 5px 3px; }
+139
// Эволюция программы
foo = true;
function foo(){
return true;
}
function foo( param ){
return int;
}
function foo( param1, param2, param3, param4, param5 ){
return result;
}
function foo( object ){
return {result1, result2};
}
class foo {
function bar( object1 ){
return result1;
}
function biz( object2 ){
return result2;
}
}
class factory {
foo = new foo();
bar = new bar();
}
server1 = new factory1();
server2 = new factory2();
// прошло миллион лет...
...а потом программа встала и пошла.
просто так
+138
# it makes sense to use it only for
# numbers up to 100
fun StringToInteger (str) {
int = -1;
for (i=0; i<=100; i++) {
if (i+"" == str) {
int = i;
break;
}
}
return int;
}
Функция преобразования строк в целые числа из кода бутскрина Ubuntu на неизвестном науке кастомном скриптовом языке.
Пруфлинк: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/plymouth/precise/view/head:/themes/ubuntu-logo/ubuntu-logo.script#L149
+127
/**
* Determines equality based upon the contents of this Box instead of the box itself.
* As a result, it is not symmetric. Which means that for
*
* <pre name="code" class="scala">
* val foo = "foo"
* val boxedFoo = Full(foo)
* foo == boxedFoo //is false
* boxedFoo == foo //is true
* </pre>
*
* For Full and Empty, this has the expected behavior. Equality in terms of Failure
* checks for equivalence of failure causes.
*/
override def equals(other: Any): Boolean = (this, other) match {
case (Full(x), Full(y)) => x == y
case (Full(x), y) => x == y
case (x, y: AnyRef) => x eq y
case _ => false
}
https://github.com/lift/framework/blob/master/core/common/src/main/scala/net/liftweb/common/Box.scala
+131
o?o.f():{};
Мне было стыдно постить это в С++.
http://www.gamedev.ru/flame/forum/?id=167142&page=2#m25
+130
<div id="busyList" class="busyList">
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
</div>
Как-то даже грустно становится...
+133
<div style='margin-top: 8px; margin-left: 2px;'><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/julii'><img src='fotki/2012-09-13-09-58-01-861mmm_tut.jpg' alt='Юлия Г' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5921")) document.getElementById("new_user_left_5921").src="fotki/2012-09-13-09-58-01-861mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/anastasiyashirshakova'><img src='fotki/2012-04-08-15-24-10-633mmm_tut.jpg' alt='Анастасия Ширшакова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5094")) document.getElementById("new_user_left_5094").src="fotki/2012-04-08-15-24-10-633mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/zoloto'><img src='fotki/2011-09-20-18-16-59-630mmm_tut.jpg' alt='Анна Золотова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5095")) document.getElementById("new_user_left_5095").src="fotki/2011-09-20-18-16-59-630mmm_tut.jpg";
</script><span style='display: inline-block; width: 62px; height: 68px;'><a href='http://www.miss.ru/angel_in_disguise'><img src='fotki/2011-10-12-13-47-56-383mmm_tut.jpg' alt='Анна Данилова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5096")) document.getElementById("new_user_left_5096").src="fotki/2011-10-12-13-47-56-383mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/alekc'><img src='fotki/2011-09-21-23-26-16-859mmm_tut.jpg' alt='Алекс Алекс' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5098")) document.getElementById("new_user_left_5098").src="fotki/2011-09-21-23-26-16-859mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/milashka_t'><img src='fotki/2011-09-23-05-36-11-815mmm_tut.jpg' alt='Таня Сакович' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5101")) document.getElementById("new_user_left_5101").src="fotki/2011-09-23-05-36-11-815mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/oksano4ka'><img src='fotki/2011-09-23-15-45-35-905mmm_tut.jpg' alt='Оксана Таштиева' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5102")) document.getElementById("new_user_left_5102").src="fotki/2011-09-23-15-45-35-905mmm_tut.jpg";
</script><span style='display: inline-block; width: 62px; height: 68px;'><a href='http://www.miss.ru/branez'><img src='fotki/2011-11-10-21-04-58-361mmm_tut.jpg' alt='Марина Бранец' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5182")) document.getElementById("new_user_left_5182").src="fotki/2011-11-10-21-04-58-361mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/kratyulianka'><img src='fotki/2011-11-10-22-08-23-802mmm_tut.jpg' alt='Yulianka Krat' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5183")) document.getElementById("new_user_left_5183").src="fotki/2011-11-10-22-08-23-802mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/romanova'><img src='fotki/2011-11-11-11-29-44-496mmm_tut.jpg' alt='Лилия Романова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5186")) document.getElementById("new_user_left_5186").src="fotki/2011-11-11-11-29-44-496mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/agafonova'><img src='fotki/2011-11-11-11-45-36-596mmm_tut.jpg' alt='Нина Агафонова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5187")) document.getElementById("new_user_left_5187").src="fotki/2011-11-11-11-45-36-596mmm_tut.jpg";
</script><span style='display: inline-block; width: 62px; height: 68px;'><a href='http://www.miss.ru/demash'><img src='fotki/2011-11-11-11-49-50-483mmm_tut.jpg' alt='Анастасия Демаш' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5188")) document.getElementById("new_user_left_5188").src="fotki/2011-11-11-11-49-50-483mmm_tut.jpg";
</script></div>
<br>
Найдено в работах одного дорогого уфимского фрилансера...
+128
#!/bin/bash
hl=`cat $1`
wrdl=`cat ~/worlds.txt`
addr=$PWD'/extra_hosts.txt'
rm -f $addr && echo "Deleted host list file "$addr
touch $addr && echo "Created file "$addr
for address in $hl
do
rm $PWD/`basename $address`.txt && echo "Deleted file "$PWD/`basename $address`.txt
done
for address in $hl
do
#echo $address
export address
tmp=$PWD/`basename $address`.txt
trc=$PWD/`basename $address`.tr.txt
mytmp=/tmp/`basename $address`.txt
curl -Ss --retry 2 --trace $trc --tr-encoding --tcp-nodelay $address > $mytmp &
sleep 10s
cat $mytmp \
| grep -e '<a href=\"[^"]*\"' | grep -E -o '[^"]+'\
| grep htm | perl -pe 's/$ENV{address}//'| \
perl -pe 's/^\//$ENV{address}\//' | perl -pe 's/text\/html//'|\
sed -e 's/<[^>]*>//g' -e '/\/http:/d;/^http/p;d;' | sort | uniq >> $addr &
for wrd in `cat ~/worlds.txt`
do
export wrd
cat -b $mytmp\
| sed -e 's/<[^>]*>//g' |grep -i $wrd \
| perl -pe 's/^/$ENV{address}:$ENV{wrd}:/' | tee -a $tmp &
done
done
mkdir -p extra_hosts && echo "Made dir extra_hosts"
cd extra_hosts
$0 $addr