This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Claude Code hook: run 'pyrefly check' to keep the repo type-clean. | |
Behavior | |
- PostToolUse (after Edit/Write/MultiEdit): fast check of the changed python file if possible, | |
else fall back to full project check. | |
- Stop: full project check at iteration end. If errors exist, block stop (exit 2) so Claude | |
continues and fixes them. Use stop_hook_active guard to prevent loops. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
# Usage: | |
# ./touch_stdlib_py.sh /Library/Frameworks/Python.framework/Versions/3.12 | |
# | |
# This will touch all .py files under .../lib/python3.12/ | |
if [[ $# -ne 1 ]]; then | |
echo "Usage: $0 <interpreter-root>" >&2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires Python 3.11+ (or install typing_extensions for older versions) | |
from __future__ import annotations | |
import os | |
import re | |
from collections import Counter, defaultdict, deque, ChainMap | |
from dataclasses import dataclass, field | |
from enum import Enum, IntEnum, Flag, auto | |
from pathlib import Path | |
from typing import ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR Could not find name `Module` [unknown-name] | |
--> /Users/aaronpollack/dev/django/django/conf/__init__.py:105:43 | |
| | |
105 | def configure(self, default_settings: Module[django.conf.global_settings]=global_settings, **options) -> None: | |
| ^^^^^^ | |
| | |
ERROR Could not find name `cls` [unknown-name] | |
--> /Users/aaronpollack/dev/django/django/contrib/admin/checks.py:25:27 | |
| | |
25 | return issubclass(cls, classinfo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- View here https://gist.githack.com/lolpack/412a1009be427dbecc29a3ab4ce85f92/raw/index.html --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Flappy You+ Configurable</title> | |
<style> | |
body { | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"name": "Let's Do It Again", | |
"artistName": "J Boog", | |
"name": "Cream On Chrome", | |
"artistName": "Ratatat", | |
"name": "Get Free (feat. Amber of Dirty Projectors)", | |
"artistName": "Major Lazer", | |
"name": "Watch Out For This (Bumaye) [feat. Busy Signal, The Flexican & FS Green]", | |
"artistName": "Major Lazer", | |
"name": "Purple Yellow Red and Blue", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'redis' | |
require 'faker' | |
client = Redis.new(:host=> '{REDIS_HOST}', :port => '6379') | |
keysCreated = 0 | |
for i in 0..3600 # 1 hour, 3600 keys created. | |
fakename = Faker::App.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
PORT_NUMBER = 8080 | |
#This class will handles any incoming request from | |
#the browser | |
class myHandler(BaseHTTPRequestHandler): | |
#Handler for the GET requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Friends JS | |
var friends = { | |
Tom: ["Mary", "Adam", "Brian"], | |
Mary: ["Tom", "Jane", "Peter", "Adam", "Elizabeth", "Brian", "Donna"], | |
Jane: ["Peter", "Mary", "Kimberly", "Emily", "Laura"], | |
Peter: ["Mary"], | |
Adam: ["Mary", "Tom"], | |
Elizabteh: ["Jennifer", "Mary"], | |
Jennifer: ["Elizabeth"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Queue Implementation | |
/* enqueue(data) - Adds a new data element to the queue | |
The parameter, data, should be the element to add. | |
dequeue(callback) - Removes the next item from the queue | |
The parameter to dequeue is a callback function that should expect two parameters - err and value. The callback's first param, err, is set to null if the queue operation was successful or "Empty" if the queue is currently empty. The callback's second parameter, value, is the value removed from the queue. | |
size() - Return the number of elements current in the queue | |
As with your stack implementation, you are not allowed to use the JavaScript array or any 3rd party libraries. Place your solution in a file called queue.js and upload it as submission of your assignment.*/ |