const ws = new WebSocket('wss://echo.websocket.org', {
		agent: new HttpsProxyAgent(`https://${proxy}`)
	});
	wsz.push(ws);
	ws.onopen = () => {
		if (ws.readyState === WebSocket.OPEN) {
			.....
			ws.close();
		}
	};
	ws.onerror = () => {
		ws.close();
	};

u just cant trust, just cant......

By Neon, 2018-10-23 18:14:26
<ng-container *ngIf="!errors">
    <div *ngIf="errors" class="no-content-wrapper">
        <esel-components-error [error]="errors"></esel-components-error>
    </div>
</ng-container>

Make your code error prone with effective error handling!

By Anonymous, 2019-10-11 12:49:41
const [glossaries, prompts] = [await getGlossaries(), await getPromps()];

// instead of
// const [glossaries, prompts] = await Promise.all([getGlossaries(), getPrompts()]);

When I was writing the code, I thought for a moment that getGlossaries() and getPrompts() will be executed in parallel

By igor, 2024-01-22 17:24:54
//class tworzenie.FaceOknoDodatki
var b = 2;
   var wlosyT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,7,4,4,7,8,9,10,6,8,6,5,5,7,8,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b];
   var brwiT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b];
   var oczyT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,5,6,6,7,8,8,8,9,9,9,10,10,10,10,10,10];
   var nosT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b];
   var brodaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,5,6,7,7,8,9];
   var ustaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,10,10];
   var czachyT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,10];
   var tatuazT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,3,7,7,7,7,8,8,8,9,9,9,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0];
   var opaskaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,8,9,10,7,8,9,8,9,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
   var kolczykiT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,3,3,4,4,5,6,5,6,7,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
   var kolczyki2T = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,3,3,6,5,8,9,4,7,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
   var bliznaT = [tworzenie.FaceOknoDodatki.prototype.b,tworzenie.FaceOknoDodatki.prototype.b,5,7,8,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];

code from some shitty polish game, character face creator

By whitemoon, 2024-03-08 19:58:38
int main() {
    int error_code = some_function();
    if (error_code == 1) {
        // In case of error, crash the program by eating up memory
        while (true) new int;
    }
}
By Anonymous, 2024-04-30 08:31:39
#define omae
#define wa (void)0
#define mou (void)0
#define shinderu ;
#define nani (void)
#define return 0; return

int main(void) {
    omae wa, mou shinderu
    nani!
    return 0;
}
By Nobody cares, 2020-05-19 06:46:01
private HashMap<String, Tuple6<float[], String[], String[], String[], String[], String>> memberNameChangedToProtectTheInnocent = null;
By Anonymous, 2017-12-12 12:13:22
var div = '<div class="imgdiv" '+(user[5] ? 'style="display: flex; flex-direction: column; padding: 10px; justify-content: flex-end; background-image: url(\''+user[5]+'\');"' : '')+'>'
        + (usersVideos[userId] && <?= ($authuser ? 'true' : 'false') ?> ? '<i class="f7-icons icon-acc" onclick="videoShow('+user[uID]+')" style="color: white; font-size: 50px; margin-bottom: 5px; cursor: pointer; text-align: left;">play_round</i>' : '')
        + (iam && page=='home' ? '<div> <input id="video-input" onchange="uploadVideo(files)" type="file" accept="video/*" style="display: none; width: 80%; height: 100px; margin: auto; padding-top: 20px;"/> </div> <p class="action_cont" style="padding: 0; padding-top: 12;"> <a class="act_btn" onmousedown=document.getElementById("video-input").click() href="javascript:void(0)" style="text-decoration: none; margin: auto; width: calc(100% - 26px); text-align: center;"> ' + (myMods['video'] ? 'Загрузить новое видео' : 'Добавить видео-превью' ) + ' </a> </p>' : '')
+ '</div>'

JS + CSS + PHP + HTML

By Anon, 2018-08-24 18:30:12
const newReply = (reply !== null) ? reply : null;
By foxy, 2018-06-04 21:19:27
reduc_ind = list(xrange(1, len(x.get_shape())))
By Anonymous, 2017-08-14 18:37:29
function renderGroupSelectedSuccessors() {
    var index = 0;
    if (tempSuccessorsGroupsList != null && tempSuccessorsGroupsList.length > 0) {
        var groups = tempSuccessorsGroupsList.splice(0, PageSettings.lazyRenderItemsPerPage);
        var groupSuccessors = '';
        for (var i = 0; i < groups.length; i++) {
            if (index % 10 == 0) {
                groupSuccessors += '<div style="float: left;"><ul>';
            }
            groupSuccessors += '<li><a data-groupid="'+groups[i].GroupID+'">' + groups[i].GroupName + '</a></li>';            
            index++;
            if (index % 10 == 0 || i == groups.length - 1) {
                groupSuccessors += '</ul></div>';
            }
        }
        $('#divGroupSuccessorsList').append(groupSuccessors);
        SetCheckBoxState();
        setTimeout(renderGroupSelectedSuccessors, 50);
    }
}

Where does the data come from? Where does it go? Why isn't this an endless recursive loop? Why has this worked for three years?

By Anonymous, 2019-05-10 13:20:47
if student_id:
    assignments = Assignment.objects.filter(week__in=weeks)

    unenrolled_students = Wave.objects.filter(week__in=weeks).values_list('unenrolled_students', flat=True)

    # Construct responses based on assignment type
    Assignment.build_assignments_for_weeks(responses, assignments, students, unenrolled_students)
    max_num_assessments = Assessment.build_assessments_for_weeks(responses)
    Comment.build_comments_for_weeks(responses, weeks, students, unenrolled_students)

elif wave_id:
    assignments = Assignment.objects.filter(week__in=weeks)

    unenrolled_students = Wave.objects.filter(week__in=weeks).values_list('unenrolled_students', flat=True)

    # Construct responses based on assignment type
    Assignment.build_assignments_for_weeks(responses, assignments, students, unenrolled_students)
    max_num_assessments = Assessment.build_assessments_for_weeks(responses)
    Comment.build_comments_for_weeks(responses, weeks, students, unenrolled_students)

else:
    # can't happen
    pass
By Anonymous, 2018-03-23 12:46:10
void winner(int score[4])
{
    
    if (score[0] > score[1] > score[2] > score[3])
        cout << "The winner is the Player 1 with " << score[0] << " points.";
    else if (score[1] > score[0] > score[2] > score[3])
        cout << "The winner is the Player 2 with " << score[1] << " points.";
    else if (score[2] > score[0] > score[1] > score[3])
        cout << "The winner is the Player 3 with " << score[2] << " points.";
    else if (score[3] > score[2] > score[1] > score[0])
        cout << "The winner is the Player 4 with " << score[3] << " points.";
}
By Anonymous, 2020-05-17 16:06:24
function clean(toClean, source){
	if (typeof(toClean) !== 'string') return true;
	if (typeof(source) !== 'string') return true;
	
	return source.replace(toClean, String('CLEANED')).toString();
}

Found this in a project at work and someone clearly doesn't trust JavaScripts typeof function

By Anonymous, 2018-06-02 22:09:57
public class MandateData {

    public final UUID coreId;
    public final UUID accountId;
    public final String accountRef;
    public final String creditorId;
    public final String creditorName;
    public final String debtorFirstName;
    public final String debtorLastName;
    public final String branchCode;
    public final String accountNumber;
    public final LocalDate signingDate;
    public final Address debtorAddress;

    private MandateData(UUID coreId, UUID accountId, String accountRef, String creditorId, String creditorName, String branchCode, String accountNumber, String debtorFirstName, String debtorLastName,
                        LocalDate signingDate, Address debtorAddress) {
        this.coreId = coreId;
        this.accountId = accountId;
        this.accountRef = accountRef;
        this.creditorId = creditorId;
        this.creditorName = creditorName;
        this.debtorFirstName = debtorFirstName;
        this.debtorLastName = debtorLastName;
        this.branchCode = branchCode;
        this.accountNumber = accountNumber;
        this.signingDate = signingDate;
        this.debtorAddress = debtorAddress;
    }

    public static MandateData creationMandateData(UUID coreId, UUID accountId, String accountRef, String creditorId, String creditorName, String branchCode, String accountNumber, String debtorFirstName, String debtorLastName,
                                                  LocalDate signingDate, Address debtorAddress) {
        return new MandateData(coreId, accountId, accountRef, creditorId, creditorName, branchCode, accountNumber, debtorFirstName, debtorLastName, signingDate, debtorAddress);
    }
}

There is an ancient and mysterious legend about public static constructor, called createShit. If anyone want's just to create an instance of Shit be aware of it! This is too obvious! just Implement static method with the exactly the same fields, and make constructor private. Don't write a shit!

By Anonymous, 2018-06-07 13:03:44