- 1
- 2
- 3
- 4
- 5
- 6
- 7
http://odnoklassniki.ru/dk
?cmd=PopLayer
&tkn=9739
&st.cmd=error
&st.stid=anonymPasswordRecovery
&st.eclass=java.lang.IllegalStateException
&st.layer.cmd=PopLayerSystemError
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+136
http://odnoklassniki.ru/dk
?cmd=PopLayer
&tkn=9739
&st.cmd=error
&st.stid=anonymPasswordRecovery
&st.eclass=java.lang.IllegalStateException
&st.layer.cmd=PopLayerSystemError
Парсер тоже видит ЭТО и предлагает положить в не «Кучу», а в «Java».
+79
public static void loadSWT() {
try {
File file = null;
if (PlatformUtils.IS_WINDOWS) {
file = new File("lib/swtwin32.jar"); // x86
if (PlatformUtils.JVM_ARCH.equals("64")) {
file = new File("lib/swtwin64.jar"); // x64
}
} else if (PlatformUtils.IS_OSX) {
file = new File("lib/swtmac32.jar"); // x86
if (PlatformUtils.JVM_ARCH.equals("64")) {
file = new File("lib/swtmac64.jar"); // x64
} else if (PlatformUtils.OS_ARCH.startsWith("ppc")) {
file = new File("lib/swtmaccb.jar"); // carbon
}
} else if (PlatformUtils.IS_LINUX) {
file = new File("lib/swtlin32.jar"); // x86
if (PlatformUtils.JVM_ARCH.equals("64")) {
file = new File("lib/swtlin64.jar"); // x64
}
}
if ((file == null) || !FileUtils.isExistingFile(file)) {
file = new File("lib/swt.jar"); // old system
}
final Method method = URLClassLoader.class.getDeclaredMethod(
"addURL", new Class[] { URL.class });
method.setAccessible(true);
method.invoke(ClassLoader.getSystemClassLoader(), file.toURI()
.toURL());
} catch (final Exception e) {
e.printStackTrace();
}
}
вот так приколачиваем SWT в систему.
особенное веселье в строках 25-28.
+49
/**
* Used to show configurable product attributes in case when all elements are out-of-stock
*
* "$_product->isSaleable() &&" should be commented out at line #100 (where "container2" block is outputted) in catalog/product/view.phtml
* to make this work
*
* @see Mage_Catalog_Model_Product::isSalable
* @param object $observer
*/
public function onCatalogProductIsSalableAfter($observer)
{
if (Mage::getStoreConfig('amstockstatus/general/outofstock'))
{
$salable = $observer->getSalable();
$stack = debug_backtrace();
foreach ($stack as $object)
{
if (isset($object['file']))
{
if ($object['file'])
{
if ( isset($object['file']) && false !== strpos($object['file'], 'options' . DIRECTORY_SEPARATOR . 'configurable'))
{
$salable->setData('is_salable', true);
}
}
}
}
}
}
Вот такой вот веселый модуль для Magento, одна из возможностей которого - отобразить опции для всех out-of-stock вариантов конфигурируемого товара.
+73
//QC 1487 - Modifying the order of creation of the SFC Teams.
//DO NOT CHANGE THE ORDER, THIS WILL DISTURB THE ORDER OF DISPLAY IN THE UI.
//The Order is 1) Credit Team 2) Comp Team 3) Servicing Team
createCreditTeam(contract); // Creating an Empty Credit Team.
createCompTeam(contract); // Creating an Empty Comp Team.
createServicingTeam(contract); // Creating an Empty Servicing Team.
+64
public class ClientSourceTranslator implements ITranslator
{
public Object map(Object input)
{
return String.valueOf(12);
}
}
+53
/**
* Магический геттер
*
* @param string $name
* @return mixed
*/
public function __get($name)
{
if ($name == $this->fileName)
return $this->fileName;
}
Magic is here
+71
private String getSecondsToTimeFormat(long startTime, long finishTime) {
int secs = Math.round((finishTime - startTime) / 1000);
int hours = secs / 3600,
remainder = secs % 3600,
minutes = remainder / 60,
seconds = remainder % 60;
StringBuilder result = new StringBuilder();
if (hours > 0) {
result.append((hours < 10 ? "0" : "") + hours).append(":");
}
if (minutes > 0 || hours > 0) {
result.append((minutes < 10 ? "0" : "") + minutes).append(":");
}
if (seconds > 0 || hours > 0 || minutes > 0) {
result.append((seconds < 10 ? "0" : "") + seconds);
}
if (hours == 0 && minutes == 0) {
if (seconds == 1) {
result.append(" second");
} else {
result.append(" seconds");
}
}
return result.toString();
}
Задача - перевести из секунд в человеческий формат
+149
Wreqr.Commands = (function(Wreqr){
"use strict";
return Wreqr.Handlers.extend({
execute: function(){
var name = arguments[0];
var args = Array.prototype.slice.call(arguments, 1);
this.getHandler(name).apply(this, args);
}
});
})(Wreqr);
из библиотеки которая претендует на популярность, шаблонность (в модном нынче смысле слова) и стэйт-оф-зэ-артность
вопрос - НАХ8Я СТРОКА 6???????
+38
isset($params) && array_push(
$urlPart,
implode('/',
array_map(
function ($key, $value) {
return $key . '/' . $value;
},
array_keys($params),
array_values($params)
)
)
);
+133
.wrapper#container {
background-color: #ffffff;
border-style: hidden;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
margin: 0 auto 0;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
width: 672px;
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
padding: 15px 20px 20px 30px;
}
Из сорса страницы Evernote, вообще там порядка 8к строк для 4 дивов....