Skip to content

Instantly share code, notes, and snippets.

View DannyAziz's full-sized avatar
🤔
Working hard or hardly working?

Danny Aziz DannyAziz

🤔
Working hard or hardly working?
View GitHub Profile
@DannyAziz
DannyAziz / notify.mdc
Created February 11, 2025 02:14
Cursor Composer notify rule on macos
---
description: At the end of any task
globs: *
---
At the end of any task run the command `osascript -e display notification "{message}" with title "{title}"`. Fill in message and title based on the task you just completed
@DannyAziz
DannyAziz / main.py
Created August 21, 2024 22:47
Perplexity Voice Search in Python
import asyncio
import websockets
import ssl
import json
import uuid as uuid_module
import wave
import struct
import re
import pyaudio
import io
@DannyAziz
DannyAziz / background.js
Created March 13, 2024 19:55
Update content script
chrome.runtime.onInstalled.addListener(async function (details) {
if (details.reason === "update") {
for (const cs of chrome.runtime.getManifest().content_scripts) {
for (const tab of await chrome.tabs.query({ url: cs.matches })) {
for (const file of cs.js) {
chrome.scripting.executeScript({
target: { tabId: tab.id, allFrames: cs.all_frames ?? false },
files: [file]
})
}
@DannyAziz
DannyAziz / base_task.py
Created May 10, 2020 18:46
celerystalk.io - Celery Class Tasks
from celery import Celery
app = Celery('NAME', broker='BROKER')
class BaseTask(app.Task):
def on_failure(self, exc, task_id, args, kwargs, einfo):
logging_tool.log(exc, task_id, args, kwargs, einfo)
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/danny/.virtualenvs/curatr/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/Users/danny/.virtualenvs/curatr/lib/python3.7/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/danny/.virtualenvs/curatr/lib/python3.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/danny/.virtualenvs/curatr/lib/python3.7/site-packages/django/core/management/base.py", line 330, in execute
Verifying my Blockstack ID is secured with the address 1DQn1jdVoTnFDyZkd2WZh59hcE5hiU61rZ https://explorer.blockstack.org/address/1DQn1jdVoTnFDyZkd2WZh59hcE5hiU61rZ
function FindProxyForURL(url, host) {
return "SOCKS 192.168.1.74:8889";
}
@DannyAziz
DannyAziz / query_places.py
Created November 19, 2015 19:06 — forked from flibbertigibbet/query_places.py
Finds the centroids of 50km hexagons to tile a bounding box and writes the coordinates to a file. Then, creates a bash script to query Google Places for each point and write the responses to files. (There's some overlap between the queried areas, but it should be minimal.) Here, it's searching for grocery stores in New Jersey.
#!/usr/bin/env python
import csv
from math import cos, pi
# API key for Google Places
api_key= 'YOUR_KEY_GOES_HERE'
outf = open('njpoints.csv','w')
w = csv.writer(outf)
@DannyAziz
DannyAziz / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>