- 1
$scope.storage.oldDriver = JSON.parse(JSON.stringify($scope.storage.driverEdit || {})); // @TODO: ни _.clone ни Object.assign не сработали
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−2
$scope.storage.oldDriver = JSON.parse(JSON.stringify($scope.storage.driverEdit || {})); // @TODO: ни _.clone ни Object.assign не сработали
Нашел на работе в коде
0
setInterval(function(){
jQuery.get('/comments', function(response){
var html=jQuery(response);
var breaked=false;
jQuery.each(html.find('.hentry'), function(){
if(!breaked){
var entry=jQuery(this);
var username=jQuery.trim(entry.find('.entry-author').first().text());
var comment=jQuery.trim(entry.find('.entry-comment').first().text());
if(username!='g0_1494089147006' && username!=''){
breaked=true;
var link=jQuery.trim(entry.find('.answer').first().attr('href'));
jQuery.get(link, function(response2){
var html2=jQuery(response2);
var form2=html2.find('form').first().serialize();
jQuery.post('https://localhost/gkwordanalyzer/wanal.php', 'q='+encodeURIComponent(comment), function(response3){
if(jQuery.trim(response3)==''){ response3='Трижды остоебу.'; }
jQuery.post(link, form2+'&text='+encodeURIComponent(response3));
});
});
}
}
});
});
}, 5000);
0
function PrepareGetList(
&$arIblockElementFields,
&$arJoinProps,
&$bOnlyCount,
&$bDistinct,
&$arSelectFields,
&$sSelect,
&$arAddSelectFields,
&$arFilter,
&$sWhere,
&$sSectionWhere,
&$arAddWhereFields,
&$arGroupBy,
&$sGroupBy,
&$arOrder,
&$arSqlOrder,
&$arAddOrderByFields,
&$arIBlockFilter,
&$arIBlockMultProps,
&$arIBlockConvProps,
&$arIBlockAllProps,
&$arIBlockNumProps,
&$arIBlockLongProps
)
{
Метод из ядра битрикса
0
<?php
/**
* FoursquareApi
* A PHP-based Foursquare client library with a focus on simplicity and ease of integration
*
* @package php-foursquare
* @author Stephen Young <[email protected]>, @hownowstephen
* @version 1.2.0
* @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
*/
// Set the default version
// @TODO: Warning when the version becomes too out of date
define("DEFAULT_VERSION", "20140201");
// I have no explanation as to why this is necessary
define("HTTP_GET","GET");
define("HTTP_POST","POST");
PHP-клиент для foursquare, рекомендуемый самим foursquare
+1
brainfuck()
.plus .plus .plus .plus .plus .plus .plus
.plus .plus .plus .plus .plus .plus .plus
.begin
.minus.next .plus .plus .plus .plus
.plus .next .plus .plus .plus .plus
.plus .plus .next .plus .plus .plus
.plus .plus .plus .prev .prev .prev
.end
.next .plus .print.next .minus.minus.minus
.minus.minus.print.next .plus .plus .print
.prev .minus.print.plus .print.minus.minus
.minus.minus.print.plus .plus .plus .plus
.print.prev .minus.minus.minus.print
https://github.com/1024--/peetooshnya/blob/master/bfdot.js
0
import '/asyncio'
main = async $ loop ->
task = "Hello, {}!".format whatever where
await asyncio.sleep 1
whatever = "World"
await task
loop = asyncio.get_event_loop!
loop.run_until_complete $ main loop
http://pyos.github.io/dg/So dynamik very hasky
0
<input type="text" id="text" hidden="true">
<script type="text/javascript">
document.getElementById('body').onkeypress = function(e) {
var text = document.getElementById('text')
if(text.value == "W" && e.key == "Q" ||
text.value == "Q" && e.key == "W" ||
text.value == "w" && e.key == "q" ||
text.value == "q" && e.key == "w" ||
text.value == "й" && e.key == "ц" ||
text.value == "ц" && e.key == "й" ||
text.value == "Й" && e.key == "Ц" ||
text.value == "Ц" && e.key == "Й")
alert("Привет!")
text.value = e.key
}
</script>
свежее говно вышло(
0
function sha256_process_block(buffer, len, ctx)
{
var words = buffer;
var nwords = len / 4;
var endp = words + nwords;
var x = [];
var a = ctx[0][0];
var b = ctx[0][1];
var c = ctx[0][2];
var d = ctx[0][3];
var e = ctx[0][4];
var f = ctx[0][5];
var g = ctx[0][6];
var h = ctx[0][7];
ctx[1][0] += len;
if(ctx[1][0] < len)
ctx[1][1]++;
while (words < endp)
{
var tm, t0, t1;
for(var t = 0; t < 16; t++)
{
x[t] = SWAP(words);
words++;
}
R( a, b, c, d, e, f, g, h, K( 0), x[ 0] );
R( h, a, b, c, d, e, f, g, K( 1), x[ 1] );
R( g, h, a, b, c, d, e, f, K( 2), x[ 2] );
R( f, g, h, a, b, c, d, e, K( 3), x[ 3] );
R( e, f, g, h, a, b, c, d, K( 4), x[ 4] );
R( d, e, f, g, h, a, b, c, K( 5), x[ 5] );
R( c, d, e, f, g, h, a, b, K( 6), x[ 6] );
R( b, c, d, e, f, g, h, a, K( 7), x[ 7] );
R( a, b, c, d, e, f, g, h, K( 8), x[ 8] );
R( h, a, b, c, d, e, f, g, K( 9), x[ 9] );
R( g, h, a, b, c, d, e, f, K(10), x[10] );
R( f, g, h, a, b, c, d, e, K(11), x[11] );
R( e, f, g, h, a, b, c, d, K(12), x[12] );
R( d, e, f, g, h, a, b, c, K(13), x[13] );
R( c, d, e, f, g, h, a, b, K(14), x[14] );
R( b, c, d, e, f, g, h, a, K(15), x[15] );
R( a, b, c, d, e, f, g, h, K(16), M(16, tm, x) );
R( h, a, b, c, d, e, f, g, K(17), M(17, tm, x) );
R( g, h, a, b, c, d, e, f, K(18), M(18, tm, x) );
R( f, g, h, a, b, c, d, e, K(19), M(19, tm, x) );
R( e, f, g, h, a, b, c, d, K(20), M(20, tm, x) );
R( d, e, f, g, h, a, b, c, K(21), M(21, tm, x) );
R( c, d, e, f, g, h, a, b, K(22), M(22, tm, x) );
R( b, c, d, e, f, g, h, a, K(23), M(23, tm, x) );
R( a, b, c, d, e, f, g, h, K(24), M(24, tm, x) );
R( h, a, b, c, d, e, f, g, K(25), M(25, tm, x) );
R( g, h, a, b, c, d, e, f, K(26), M(26, tm, x) );
R( f, g, h, a, b, c, d, e, K(27), M(27, tm, x) );
R( e, f, g, h, a, b, c, d, K(28), M(28, tm, x) );
R( d, e, f, g, h, a, b, c, K(29), M(29, tm, x) );
R( c, d, e, f, g, h, a, b, K(30), M(30, tm, x) );
R( b, c, d, e, f, g, h, a, K(31), M(31, tm, x) );
R( a, b, c, d, e, f, g, h, K(32), M(32, tm, x) );
R( h, a, b, c, d, e, f, g, K(33), M(33, tm, x) );
R( g, h, a, b, c, d, e, f, K(34), M(34, tm, x) );
R( f, g, h, a, b, c, d, e, K(35), M(35, tm, x) );
R( e, f, g, h, a, b, c, d, K(36), M(36, tm, x) );
R( d, e, f, g, h, a, b, c, K(37), M(37, tm, x) );
R( c, d, e, f, g, h, a, b, K(38), M(38, tm, x) );
R( b, c, d, e, f, g, h, a, K(39), M(39, tm, x) );
R( a, b, c, d, e, f, g, h, K(40), M(40, tm, x) );
R( h, a, b, c, d, e, f, g, K(41), M(41, tm, x) );
R( g, h, a, b, c, d, e, f, K(42), M(42, tm, x) );
R( f, g, h, a, b, c, d, e, K(43), M(43, tm, x) );
R( e, f, g, h, a, b, c, d, K(44), M(44, tm, x) );
R( d, e, f, g, h, a, b, c, K(45), M(45, tm, x) );
R( c, d, e, f, g, h, a, b, K(46), M(46, tm, x) );
R( b, c, d, e, f, g, h, a, K(47), M(47, tm, x) );
R( a, b, c, d, e, f, g, h, K(48), M(48, tm, x) );
R( h, a, b, c, d, e, f, g, K(49), M(49, tm, x) );
R( g, h, a, b, c, d, e, f, K(50), M(50, tm, x) );
R( f, g, h, a, b, c, d, e, K(51), M(51, tm, x) );
R( e, f, g, h, a, b, c, d, K(52), M(52, tm, x) );
R( d, e, f, g, h, a, b, c, K(53), M(53, tm, x) );
R( c, d, e, f, g, h, a, b, K(54), M(54, tm, x) );
R( b, c, d, e, f, g, h, a, K(55), M(55, tm, x) );
R( a, b, c, d, e, f, g, h, K(56), M(56, tm, x) );
R( h, a, b, c, d, e, f, g, K(57), M(57, tm, x) );
R( g, h, a, b, c, d, e, f, K(58), M(58, tm, x) );
R( f, g, h, a, b, c, d, e, K(59), M(59, tm, x) );
R( e, f, g, h, a, b, c, d, K(60), M(60, tm, x) );
R( d, e, f, g, h, a, b, c, K(61), M(61, tm, x) );
R( c, d, e, f, g, h, a, b, K(62), M(62, tm, x) );
R( b, c, d, e, f, g, h, a, K(63), M(63, tm, x) );
a = ctx[0][0]+=a;
b = ctx[0][1]+=b;
c = ctx[0][1]+=b;
d = ctx[0][1]+=b;
e = ctx[0][1]+=b;
f = ctx[0][1]+=b;
g = ctx[0][1]+=b;
h = ctx[0][1]+=b;
}
}
Пытался переписать sha256 на js и заебался!
Это пиздец как сложно, сложнее только вынуть хуй который застрял в банке с шомпанским на новый год
−1
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Main implements ActionListener{
private JFrame frame;
private JTextArea area;
private JTextField fieldName, fieldAge, fieldWeight, fieldHeight, fieldSex;
private JButton button;
public static void main(String[] args) throws Exception{
Main main = new Main();
main.go();
}
public void go(){
frame = new JFrame();
JPanel panel = new JPanel();
JLabel labelName = new JLabel("Имя: ");
JLabel labelSex = new JLabel("Пол: ");
JLabel labelAge = new JLabel("Возраст: ");
JLabel labelWeight = new JLabel("Вес: ");
JLabel labelHeight = new JLabel("Рост: ");
fieldName = new JTextField(10);
fieldAge = new JTextField(10);
fieldWeight = new JTextField(10);
fieldHeight = new JTextField(10);
fieldSex = new JTextField(10);
area = new JTextArea(6, 73);
area.setWrapStyleWord(true);
area.setLineWrap(true);
button = new JButton("Расчитать");
button.addActionListener(this);
JScrollPane scroller = new JScrollPane(area);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
panel.add(labelName);
panel.add(fieldName);
panel.add(labelSex);
panel.add(fieldSex);
panel.add(labelAge);
panel.add(fieldAge);
panel.add(labelWeight);
panel.add(fieldWeight);
panel.add(labelHeight);
panel.add(fieldHeight);
panel.add(area);
frame.getContentPane().add(BorderLayout.CENTER, panel);
frame.getContentPane().add(BorderLayout.SOUTH, button);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1000, 200);
frame.setTitle("Расход калорий");
frame.setVisible(true);
}
public double bmrM(){
return 88.362 + (13.397 * Integer.parseInt(fieldWeight.getText())) + (6.25 * Integer.parseInt(fieldHeight.getText())) - (5 * Integer.parseInt(fieldAge.getText())) + 5;
}
public double bmrW(){
return 88.362 + (13.397 * Integer.parseInt(fieldWeight.getText())) + (6.25 * Integer.parseInt(fieldHeight.getText())) - (5 * Integer.parseInt(fieldAge.getText())) - 161;
}
public void actionPerformed(ActionEvent event){
if (fieldSex.getText().equals("Мужской") || fieldSex.getText().equals("мужской")){
area.setText(fieldName.getText() + ", ваш расход в спокойном режиме(без тренировочного процесса) составляет - " + bmrM() + " калорий.");
}else{
area.setText(fieldName.getText() + ", ваш расход в спокойном режиме(без тренировочного процесса) составляет - " + bmrW() + " калорий.");
}
}
}
Программа по расчету калорий!
Помогите улучшить код! КАК СОКРАТИТЬ???
+1
$data->setReferrerCode($data->getReferrerCode());