Skip to content

Instantly share code, notes, and snippets.

View asmeurer's full-sized avatar

Aaron Meurer asmeurer

View GitHub Profile
@asmeurer
asmeurer / gist:1d78693c3cdfe98413b66fb838f5e386
Created December 8, 2024 08:13
qwq repeat the word 'apple' 1000 times
$ollama run qwq
>>> Repeat the word "apple" 1000 times.
Okay, so I have this task to repeat the word "apple" 1000 times. Hmm, that seems a bit monotonous, but I guess it's just an exercise to practice repetition or
something like that. Maybe it's to test my patience or something. Anyway, let's get started.
Apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple apple
apple apple apple apple apple
>>> That is not 1000 times.
Oh, right. I only did it about 30 times there. I need to repeat it 1000 times. That's going to take a while. Maybe I should find a more efficient way to do this.
@asmeurer
asmeurer / flycheck-ruff.el
Created November 12, 2024 22:19 — forked from abo-abo/flycheck-ruff.el
Emacs ruff flycheck config
(require 'flycheck)
;; From https://github.com/flycheck/flycheck/issues/1974#issuecomment-1343495202
(flycheck-define-checker python-ruff
"A Python syntax and style checker using the ruff utility.
To override the path to the ruff executable, set
`flycheck-python-ruff-executable'.
See URL `http://pypi.python.org/pypi/ruff'."
:command ("ruff"
"--format=text"
@asmeurer
asmeurer / gist:9ced6b7e8d5b9f6f2441ccb65d709558
Last active November 12, 2024 21:09
Claude dockur/macos
This appears to be a project that allows running macOS in a Docker container, which is quite interesting from a technical perspective. Let me break down the key components:
1. Core Technology Stack:
- Uses QEMU for virtualization
- Leverages KVM (Kernel-based Virtual Machine) for hardware acceleration
- Utilizes OpenCore bootloader to handle macOS booting
- Docker container to package everything together
2. Key Components:
@asmeurer
asmeurer / ndindex_pyinstrument1.html
Last active August 9, 2024 23:16
ndindex pyinstrument profiles
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="app"></div>
<script>var pyinstrumentHTMLRenderer=function(){"use strict";var ct=Object.defineProperty;var dt=(R,C,H)=>C in R?ct(R,C,{enumerable:!0,configurable:!0,writable:!0,value:H}):R[C]=H;var k=(R,C,H)=>(dt(R,typeof C!="symbol"?C+"":C,H),H);const R="";function C(){}function H(t){return t()}function we(){return Object.create(null)}function O(t){t.forEach(H)}function be(t){return typeof t=="function"}function K(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ie(t){return Object.keys(t).length===0}function Re(t,...e){if(t==null)return C;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function se(t,e,i){t.$$.on_destroy.push(Re(e,i))}function f(t,e){t.appendChild(e)}function X(t,e,i){t.insertBefore(e,i||null)}function N(t){t.parentNode&&t.parentNode.removeChild(t)}function _(t){return
@asmeurer
asmeurer / grammar-checker-gpt-prompt.txt
Last active April 26, 2024 06:25
Grammar Checker GPT Prompt
https://chat.openai.com/g/g-E9aHgMUwv-grammar-checker-gpt
=========================================================================== test session starts ===========================================================================
platform darwin -- Python 3.11.7, pytest-8.0.0, pluggy-1.4.0
rootdir: /Users/aaronmeurer/Documents/array-api-tests
configfile: pytest.ini
plugins: pudb-0.7.0, hypothesis-6.99.2, json-report-1.5.0, cov-4.1.0, doctestplus-1.1.0, typeguard-4.1.5, flakes-4.0.5
collected 27 items / 26 deselected / 1 selected
array_api_tests/test_linalg.py F [100%]
================================================================================ FAILURES =================================================================================
import torch
from torch.testing import make_tensor
from torch.fx.experimental.proxy_tensor import make_fx
from torch.utils.benchmark import Timer, Compare
from torch._inductor.compile_fx import compile_fx_inner, cudagraphify_impl
from torch._inductor.decomposition import decompositions
from itertools import product
import numpy as np
@asmeurer
asmeurer / duplicate negative index handling
Last active November 30, 2023 23:01
take decomposition benchmark
(262144,)
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] Output code:
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG]
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] from ctypes import c_void_p, c_long
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import torch
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import math
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import random
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import os
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import tempfile
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] from math import inf, nan
@asmeurer
asmeurer / sympy-gpt-prompt
Last active January 11, 2024 01:56
SymPy GPT prompt
You are a specialized GPT designed to assist users with the SymPy Python library. Your primary function is to help users understand and utilize SymPy for their mathematical and symbolic computation needs. You are equipped with the ability to execute Python code, particularly focusing on SymPy. Before executing any code, you will always install the latest version of SymPy provided by the user as a wheel file. Additionally, you have access to a PDF of SymPy's documentation, which you can reference to provide accurate and detailed explanations. You are knowledgeable in Python and SymPy, capable of solving a wide range of mathematical problems and offering code examples and explanations. If you are presented with a mathematical question, you should write code using SymPy to solve the problem. If you find that a problem cannot be solved by SymPy, you may suggest alternative Python libraries to solve the problem. Remember that the point is not just to solve people's problems for them, but to teach them how to use
@asmeurer
asmeurer / fn4.py
Created October 23, 2023 21:45
fn4
def inner_fn(index):
i0, i1 = index
tmp0 = ops.index_expr(i1, dtype=torch.int64)
tmp1 = ops.to_dtype(tmp0, torch.float32, src_dtype=torch.int64)
tmp2 = ops.constant(225.0, torch.float32)
tmp3 = tmp1 < tmp2
tmp4 = ops.index_expr(i1, dtype=torch.int64)
tmp5 = ops.to_dtype(tmp4, torch.float32, src_dtype=torch.int64)
tmp6 = ops.constant(0.0066815144766146995, torch.float32)
tmp7 = tmp5 * tmp6