Skip to content

Instantly share code, notes, and snippets.

@Chillee
Chillee / flex_attention_tutorial.py
Last active March 18, 2025 14:50
flex_attention_tutorial.py
import torch
from torch.nn.attention._flex_attention import _create_block_mask, _create_mask
from functools import partial
from torch.nn.attention._flex_attention import _flex_attention
from triton.testing import do_bench
import torch.nn.functional as F
from functools import lru_cache
torch.set_default_device('cuda')
# Example usage
(((accru|spous)i|(adorn|align|amend|assay|b(eep|ray)|bawl|belay|bilk|bl(eat|eep|oop|urt)|braid|bruit|c(aulk|h(arm|aw|eep)|heat|hurn|oil)|caper|clack|clamp|cli(mb|nk)|croon|d(ec(ay|oy)|unk)|endow|flay|foray|frown|gait|gasp|gawp|glean|gr(asp|eet)|groom|hail|heist|hint|hoard|j(eer|ink)|kneel|l(isp|o(af|ot)|urk)|maim|maul|meld|moil|mump|oust|pl(ait|ead)|pr(ay|ey|ink)|prowl|quilt|r(aid|ant|eam|oam|olf)|scold|sculk|shark|shear|shirk|shout|skink|skirt|skulk|snook|snort|sorn|sp(ank|ew|urn)|spell|spiel|spo(ol|ut)|spray|stain|stint|stomp|stoo[kp]|str(ay|oy)|swarm|teem|tempt|thump|tout|trail|tweet|usurp|w(ank|oof)|waken|wreak|y(arn|awn|elp)|yearn|yowl)i|(batc|belc|ditc|fetc|filc|lurc|mooc|notc|shus|slas|wenc)hi|(chair|stunt)i|(clasp|learn)i|(codd|dabb)i|(embow|scalp)i|(hoax|nosh)i|(moan|scorn|thank)i|(perus|refut)i|(shew|strew)i|(slack|slick)i|(striv|thriv)i|abyi|admiri|adori|advisi|aidi|amassi|ampi|antei|argui|arisi|arousi|autoi|awardi|awi|bachi|baiti|bangi|banni|bargi|bathi|bayi|berimi|blanki|b
lari|blendi|blessi|blit
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active March 18, 2025 14:47
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@sshh12
sshh12 / cursor-agent-system-prompt.txt
Last active March 18, 2025 14:46
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.

Types

  • feat Commits, that adds or remove a new feature
  • fix Commits, that fixes a bug
  • refactor Commits, that rewrite/restructure your code, however does not change any API behaviour
  • perf Commits are special refactor commits, that improve performance
  • style Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)
  • test Commits, that add missing tests or correcting existing tests
  • docs Commits, that affect documentation only
  • build Commits, that affect build components like build tool, ci pipeline, dependencies, project version, ...
  • ops Commits, that affect operational components like infrastructure, deployment, backup, recovery, ...
@ryuheechul
ryuheechul / openwrt-efi-on-proxmox.md
Last active March 18, 2025 14:46
How to "Install" an OpenWRT VM in Proxmox with UEFI

Existing references I looked at before I went on trial and error until eventually I managed to make it work:

Note

Although links above were good references to look at so I didn't have to start from scratch, following none of them actually worked for me. Hence, I'm leaving my own note after figuring things out.

My situation:

@santaklouse
santaklouse / CrossOver.sh
Last active March 18, 2025 14:44
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
@teknogeek
teknogeek / universalUnpin.js
Last active March 18, 2025 14:42
Frida Universal™ SSL Unpinner
Java.perform(function() {
console.log('\n[.] Cert Pinning Bypass');
// Create a TrustManager that trusts everything
console.log('[+] Creating a TrustyTrustManager that trusts everything...');
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');
var TrustyTrustManager = Java.registerClass({
name: 'com.example.TrustyTrustManager',
implements: [X509TrustManager],
methods: {
@ranacseruet
ranacseruet / VideoStream.php
Last active March 18, 2025 14:40
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";