Skip to content

Instantly share code, notes, and snippets.

@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active June 27, 2024 17:48
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@sdnts
sdnts / example.md
Last active January 10, 2023 20:50
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});
@cesurapp
cesurapp / AuthorizationChecker.php
Created November 30, 2019 19:17
Symfony 4.4 or 5.x Override AuthorizationChecker
<?php
# src/Security/AuthorizationChecker.php
namespace App\Security;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
@danieloliveira117
danieloliveira117 / remove-youtube-shorts.js
Last active August 7, 2023 11:34
Hide youtube shorts from subscription page
// ==UserScript==
// @name Hide youtube #shorts
// @namespace https://gist.github.com/danieloliveira117/8d129abcc5d744890c9bd55f1c122472
// @version 1.5
// @description Remove youtube shorts from subscriptions (Only in grid view)
// @author danieloliveira117
// @match https://*.youtube.com/feed/subscriptions
// @grant none
// ==/UserScript==