Skip to content

Instantly share code, notes, and snippets.

View omarabid's full-sized avatar
🏠
Working from home

Abid Omar omarabid

🏠
Working from home
View GitHub Profile
Let's analyze the handler type and the overall design, and then suggest improvements.
Current Design Analysis
handlers: RefCell<HashMap<String, Box<dyn Fn(Vec<Box<dyn Any>>)>>>: This is the core of the question. It stores event handlers.
String: Event name (key). Seems reasonable.
Box<dyn Fn(Vec<Box<dyn Any>>)>: The handler itself. This is the part we'll scrutinize. It takes a Vec<Box<dyn Any>> as input.
@omarabid
omarabid / gist:038678cc269a3f2db756a7e082526f17
Created January 26, 2025 09:44
Calculating Product of Four Large Numbers (DeepSeek R1)
144 x 443 x 993 x 223
Okay, so I need to multiply these four numbers: 144, 443, 993, and 223. Hmm, that seems like a lot. Let me think about how to approach this step by step. I know that multiplying all of them at once might be complicated, so maybe breaking it down into smaller parts would be better. Let me start by multiplying the first two numbers, 144 and 443, and then multiply the result by 993, and finally multiply that by 223. But before jumping into calculations, maybe I can check if there's a smarter way to simplify this, like looking for factors that can make the multiplication easier.
First, let me write down the numbers: 144 × 443 × 993 × 223. Let me see if any of these numbers can be broken down into smaller factors that might pair nicely with others. For instance, 144 is 12 squared, which is 12 × 12. 443... Hmm, is that a prime number? Let me check. 443 divided by 2 is not an integer, 443 divided by 3 is 147.666..., so not divisible by 3. The square root of 443 is about 21, so I need to check
### Keybase proof
I hereby claim:
* I am omarabid on github.
* I am omarabid (https://keybase.io/omarabid) on keybase.
* I have a public key whose fingerprint is 13CD F1A2 9AC0 DD7E 62C0 913C 0E65 114A 9326 DD61
To claim this, I am signing this object:
@omarabid
omarabid / Usage
Created December 19, 2011 09:24
PayPal ExpressCheckout for WordPress
PayPal ExpressCheckout for WordPress
Usage:
1. Declare an array with all the required parameters.
2. Create a new instance of the class. Set the second parameter to true if you want to enable SandBox mode.
3. Get the redirect URL with the doExpressCheckout function.
4. Redirect the user to that URL to request permission.
5. Use the processPayment function to process the payment.