Skip to content

Instantly share code, notes, and snippets.

View shuki25's full-sized avatar

dr. josh butler shuki25

View GitHub Profile
@corenting
corenting / ed_notes.md
Last active February 12, 2025 17:21
Elite: Dangerous APIs findings
@luismts
luismts / GitCommitBestPractices.md
Last active March 13, 2025 09:10
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@olivx
olivx / cropper.min.css
Created June 15, 2018 17:17
Crop Image user profile django & jquery
/*!
* Cropper v3.0.0-beta
* https://github.com/fengyuanchen/cropper
*
* Copyright (c) 2017 Fengyuan Chen
* Released under the MIT license
*
* Date: 2017-02-25T07:44:44.656Z
*/
@peterellisjones
peterellisjones / Chess Perft test positions
Last active November 23, 2024 16:07
Test positions for debugging chess engines. Formatted as JSON array of FEN strings
[
{
"depth":1,
"nodes":8,
"fen":"r6r/1b2k1bq/8/8/7B/8/8/R3K2R b KQ - 3 2"
},
{
"depth":1,
"nodes":8,
"fen":"8/8/8/2k5/2pP4/8/B7/4K3 b - d3 0 3"
@carymrobbins
carymrobbins / raw_as_qs.py
Last active March 25, 2022 12:21
Django - convert RawQuerySet to QuerySet
from django.db import connection, models
class MyManager(Manager):
def raw_as_qs(self, raw_query, params=()):
"""Execute a raw query and return a QuerySet. The first column in the
result set must be the id field for the model.
:type raw_query: str | unicode
:type params: tuple[T] | dict[str | unicode, T]
:rtype: django.db.models.query.QuerySet
"""
@sigilioso
sigilioso / cuter.py
Created June 19, 2012 22:58
Python PIL Example: get a thumbnail by resizing and cropping an image.
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.