Skip to content

Instantly share code, notes, and snippets.

@sktse
sktse / code-reviews.md
Last active August 16, 2022 17:02
How to Keep Pull Requests Manageable

How to Keep Pull Requests Manageable

  • There are a lot different things you can try to keep pull requests manageable.
  • These pointers are not meant to be rules, but merely guidelines when possible. Due to the nature of what you are working on, some of these techniques may not be possible (or incredibly difficult).

More like guidelines

  • Either way, here are some tips to help make people not want to claw their eyes out reviewing a pull request.

The Basics

  • These are the fundamental basics to a pull request and ALL pull requests should have these, regardless of how small or meaningless it is.
@rbw
rbw / part_of_day.py
Last active October 17, 2022 22:44
Get part of day (morning, afternoon, evening, night) in Python3.6+
#!/usr/bin/env python3
def get_part_of_day(h):
return (
"morning"
if 5 <= h <= 11
else "afternoon"
if 12 <= h <= 17
else "evening"
@thismatters
thismatters / 0001_migrate_to_encrypted.py
Last active March 5, 2024 00:07
Migrating existing columns to use django-cryptography
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django_cryptography.fields import encrypt
app_with_model = 'account'
model_with_column = 'User'
column_to_encrypt = 'email_address'
column_field_class = models.CharField
@kennwhite
kennwhite / chicken_shrimp_korma_mortal_v1.md
Last active April 17, 2019 17:24
Restaurant style chicken/prawn korma - mere mortal version (v. 1)

Kenn's Chicken/King Prawn Coconut Curry (Korma)

Ingredients

  • 2 cups red or yellow onions, well peeled, loosely chopped
  • 6 cloves peeled garlic, finely grated
  • 2" peeled ginger root, finely grated
  • Optional: 1 medium serrano green pepper, seeded & cored, finely minced (leave out for no heat, use half pepper for medium, full for spicy)
  • 14 oz plain greek yogurt (2% or whole milk, eg FAGE 5%)
  • large can (~14 oz) unsweetened coconut milk (ideally containing no guar gum; well blended if it does)
  • 3 TB cashew butter
@WAUthethird
WAUthethird / Interacting_with_Jukebox_VastAI.ipynb
Last active February 13, 2024 07:10
Using vast.ai with OpenAI Jukebox
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.