-
Learn and Practice best-practices. Have a styleguide and a shared understanding of what features are approprate to use, and when. Your problems are probably not that unique so if someone from another company with Django experience dropped into your codebase they should be immediately productive.
-
Application architecture can be really important for keeping complexity under control. Design your apps "to do one thing, and do them well". Try to avoid ending up with a single app with a giant models.py file where everything is dependent on everything else. Create multiple apps and make sure you don't add circular dependencies. If it helps you can think of each app as a microservice. Present a good and limited API to communicate between them.
This file contains 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
""" | |
TODOPlugin api library based on spec from https://platform.openai.com/docs/plugins/examples | |
Generated via: | |
Given the compressed api specification below, write a python library for interacting with the TODO api. | |
OAS3|TODO Plugin|v1|https://example.com|/todos/{username}|get|getTodos|path|username|string|Get the list of todos|200|application/json|#/components/schemas/getTodosResponse|post|addTodo|Add a todo to the list|requestBody|#/components/schemas/addTodoRequest|delete|deleteTodo|Delete a todo from the list|#/components/schemas/deleteTodoRequest|getTodosResponse|object|array|items|string|The list of todos.|addTodoRequest|todo|string|The todo to add to the list.|deleteTodoRequest|todo_idx|integer|The index of the todo to delete. | |
""" | |
import requests |
This file contains 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
#include <ArduCAM.h> | |
#include <SPI.h> | |
#include <Wire.h> | |
#include <base64.hpp> | |
#define cameraconnection Serial1 | |
#define SPI_CS 8 | |
ArduCAM myCAM(OV2640, SPI_CS); |
This file contains 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
#include <Adafruit_VC0706.h> | |
#include <base64.hpp> | |
#define cameraconnection Serial1 | |
Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection); | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); |
This file contains 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
import pandas as pd | |
import requests | |
from bs4 import BeautifulSoup | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
# Método para extrair várias páginas de uma só vez | |
def scrape_stats(base_url, year_start, year_end): | |
years = range(year_start,year_end+1,1) |
This file contains 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 applying plan: | |
1 error(s) occurred: | |
* aws_instance.vpn: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue. | |
Please include the following information in your report: | |
Terraform Version: 0.6.16 | |
Resource ID: aws_instance.vpn |
I hereby claim:
- I am rhettg on github.
- I am rhettg (https://keybase.io/rhettg) on keybase.
- I have a public key ASDZdSujGb58CvIN-DJZGdfI-XoOb9gB_Fp-h7t4Ynhe8wo
To claim this, I am signing this object:
This file contains 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
package main | |
import "fmt" | |
func repeater(in, out chan string) { | |
msg := "" | |
for { | |
select { | |
case msg = <-in: | |
fmt.Printf("Updated to %s\n", msg) |
This file contains 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
import argparse | |
import requests | |
import pprint | |
import json | |
import sys | |
BASEHOST = "http://127.0.0.1:8500" | |
def force_release(key): | |
r = requests.get( |
This file contains 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
class SnappyDecompressor(object): | |
def __init__(self, file): | |
self._file = file | |
self._header_found = False | |
def __iter__(self): | |
return self | |
def next(self): |
NewerOlder