Skip to content

Instantly share code, notes, and snippets.

[0,1,0,0,2,10,4,40,92,352,724,2680,14200,73712,365596]
@dragonhuntr
dragonhuntr / uml.mermaid
Created September 25, 2025 15:14
m5uml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dragonhuntr
dragonhuntr / ColorDrawing.java
Created September 17, 2025 13:21
ColorDrawing
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.BorderLayout;
public class ColorDrawing extends JFrame {
private int n;
private int p;
JPanel canvas = new JPanel();
# File operations
## Open file
```python
with open('mytext.txt', 'r', encoding='utf-8') as f:
content = f.read()
```
## Example
# OOP
## Class Definition
```python
class ClassName:
def __init__(self): # Constructor (like JS `constructor`)
self.attribute = value # Instance variable
def method_name(self): # Method (uses `self` like `this` in JS)
originals
736x
564x
474x
237x
236x
170x
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.util.Stack;
public class Calculator implements ActionListener {
private static JTextField inputBox;
@dragonhuntr
dragonhuntr / chrome pause before redirect.txt
Created April 6, 2022 08:23
chrome pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
//add ?akamai=0 behind your requests
//video for indepth guide on why it works: https://youtu.be/ub82Xb1C8os
const axios = require('axios')
axios({
method: 'POST',
url: 'https://unite.nike.com/login?akamai=0',
data: '{"username":"[email protected]","password":"123"}'
})