This document provides guidelines for maintaining high-quality Python code. These rules MUST be followed by all AI coding agents and contributors.
All code you write MUST be fully optimized.
"Fully optimized" includes:
| from fastapi import Request, HTTPException | |
| from pydantic import BaseModel, BaseModel, HttpUrl | |
| from modal import Secret, App, web_endpoint, Image | |
| from typing import Optional, List | |
| from example import proposal | |
| import os | |
| app = App(name="circleback", image=Image.debian_slim().pip_install("openai", "pydantic", "fastapi")) | |
| class Attendee(BaseModel): |
First install Brew on your MAC
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew updatebrew tap homebrew/dupesbrew tap homebrew/phpbrew install php70mcrypt: brew install mcrypt php70-mcryptbrew install composer| ## convert HTML POST data or HTTP GET query string to JSON | |
| ## get the raw post data from the AWS built-in variable and give it a nicer name | |
| #if ($context.httpMethod == "POST") | |
| #set($rawAPIData = $input.path("$")) | |
| #elseif ($context.httpMethod == "GET") | |
| #set($rawAPIData = $input.params().querystring) | |
| #set($rawAPIData = $rawAPIData.toString()) | |
| #set($rawAPIDataLength = $rawAPIData.length() - 1) | |
| #set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength)) |
| <?php | |
| /* | |
| Plugin Name: Admin Filter BY Custom Fields | |
| Plugin URI: http://en.bainternet.info | |
| Description: Filter posts or pages in admin by custom fields (post meta) | |
| Version: 1.0 | |
| Author: Bainternet | |
| Author URI: http://en.bainternet.info | |
| */ |
| // Came from the comments here: https://gist.github.com/maruf-nc/5625869 | |
| app.filter('titlecase', function() { | |
| return function (input) { | |
| var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i; | |
| input = input.toLowerCase(); | |
| return input.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function(match, index, title) { | |
| if (index > 0 && index + match.length !== title.length && | |
| match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && | |
| (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') && |
| /*************************************************** | |
| * Simple and elegant, no code complexity | |
| * Disadvantages: Requires warming all data into server memory (could take a long time for MBs of data or millions of records) | |
| * (This disadvantage should go away as we add optimizations to the core product) | |
| ***************************************************/ | |
| var fb = firebase.database.ref(); | |
| /** | |
| * @param {string} emailAddress |
| license: gpl-3.0 |
| <!-- Raven.js Config --> | |
| <script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| // Ignore list based off: https://gist.github.com/1878283 | |
| var ravenOptions = { | |
| // Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion. | |
| // See: https://github.com/getsentry/raven-js/issues/73 | |
| ignoreErrors: [ | |
| // Random plugins/extensions | |
| 'top.GLOBALS', |