Skip to content

Instantly share code, notes, and snippets.

View JayPalm's full-sized avatar

Justin JayPalm

  • Santa Barbara, CA
View GitHub Profile
@dmontagu
dmontagu / fastapi_cbv.py
Last active July 17, 2024 04:08
FastAPI CBV
import inspect
from typing import Any, Callable, List, Type, TypeVar, Union, get_type_hints
from fastapi import APIRouter, Depends
from pydantic.typing import is_classvar
from starlette.routing import Route, WebSocketRoute
T = TypeVar("T")
CBV_CLASS_KEY = "__cbv_class__"
@nileshk
nileshk / app.conf
Created February 2, 2018 02:48
supervisord config for Django + pyenv + pyenv-virtualenv + gunicorn
[program:_appname_]
command = /home/_username_/.pyenv/versions/venvname/bin/gunicorn -w 1 -b 127.0.0.1:8000 --pythonpath=. --reload wsgi:application
directory=/home/_username_/sites/_appname_/
environment=PATH="/home/_username_/.pyenv/versions/venvname/bin:/home/_username_/.pyenv/shims:/home/_username_/.pyenv/bin:",DJANGO_SETTINGS_MODULE="_appname_.settings",HOME="/home/_username_"
user=_username_
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT
stderr_logfile=/home/_username_/log/_appname_-stderr.log
@DMcP89
DMcP89 / Scanner.py
Last active July 1, 2024 04:51
python script to scan network for mac address
#!/usr/bin/python
import nmap
target_mac = '<Enter MAC Adress>'
nm = nmap.PortScanner()
nm.scan(hosts='192.168.1.0/24', arguments='-sP')
@patrickvossler18
patrickvossler18 / venmo_scrape.py
Created October 13, 2015 22:48
Python script for scraping venmo transactions from Venmo's public API. This script can be run on an amazon web server with a simple nohup command to produce a csv with transaction data.
# -*- coding: utf-8 -*-
import requests
import json
from datetime import datetime
import csv
import time
class scraping:
def __init__(self):
@kageurufu
kageurufu / flask.py
Created October 3, 2013 17:42
Flask-WTF FieldLists with Dynamic Entries
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.wtf import Form
from flask.ext.babel import gettext
from wtforms import SelectField, TelField, TextField, FormField, Fieldlist, SubmitField
from wtforms.validators import Optional, Required
app = Flask(__name__)
db = SQLAlchemy(app)
@andphe
andphe / gist:3232343
Created August 2, 2012 01:41
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'