Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kriscarilloxyz's full-sized avatar
🇵🇭
Pinas UTC +8

Kris Carillo kriscarilloxyz

🇵🇭
Pinas UTC +8
View GitHub Profile
@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active February 21, 2024 02:16
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@prasofty
prasofty / margin_padding_helper.css
Last active April 10, 2023 17:29
Margin Padding Helper CSS
.p-0 {
padding: 0px;
}
.p-3 {
padding: 3px;
}
.p-5 {
padding: 5px;
@NicolasRitouet
NicolasRitouet / cd-aws-s3-wercker.md
Last active June 13, 2018 19:03
How to automate deployment on AWS S3 with bitbucket (or github) and wercker

This tutorial explains how to deploy automatically from bitbucket (or github) to AWS S3.

Create a bitbucket repository (public or private).

Add this repo on Wercker

  • Go to Create Application
  • Select use bitbucket (or github)
  • Choose your repo
  • For the next questions, choose the default answers
@alanhamlett
alanhamlett / api.py
Last active January 24, 2023 21:03
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort
@JeffPaine
JeffPaine / us_state_abbreviations.py
Last active March 12, 2024 04:39
A python list of all US state abbreviations.
# United States Postal Service (USPS) abbreviations.
abbreviations = [
# https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States#States.
"AK", "AL", "AR", "AZ", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "IA",
"ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME", "MI", "MN", "MO",
"MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK",
"OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VT", "WA", "WI",
"WV", "WY",
# https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States#Federal_district.
"DC",