Skip to content

Instantly share code, notes, and snippets.

View darius-sas's full-sized avatar

Darius Sas darius-sas

View GitHub Profile
@Gustavo-Kuze
Gustavo-Kuze / force-ctrl-c-v.md
Last active November 9, 2025 20:48
Enable copy and paste in a webpage from the browser console
javascript:(function(){
  allowCopyAndPaste = function(e){
  e.stopImmediatePropagation();
  return true;
  };
  document.addEventListener('copy', allowCopyAndPaste, true);
  document.addEventListener('paste', allowCopyAndPaste, true);
  document.addEventListener('onpaste', allowCopyAndPaste, true);
})(); 
@kantenkugel
kantenkugel / FixedSizeCache.java
Last active November 19, 2025 12:22
Java Cache with Map/List and maximum size
import java.util.HashMap;
import java.util.Map;
public class FixedSizeCache<K, V> {
private final Map<K, V> map = new HashMap<>();
private final K[] keys;
private int currIndex = 0;
public FixedSizeCache(int size) {
if(size < 1)