Skip to content

Instantly share code, notes, and snippets.

View vatsal0601's full-sized avatar

Vatsal Sakariya vatsal0601

View GitHub Profile
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@stereokai
stereokai / gist:36dc0095b9d24ce93b045e2ddc60d7a0
Last active July 10, 2024 00:23
CSS rounded corners with gradient border
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: padding-box, border-box;
}
@davewsmith
davewsmith / sqlalchemy cascading delete oddity.md
Last active October 4, 2022 17:31
SQLAlchemy: `relationship` interferes with `cascade='DELETE'`

There's an oddity in SQLAlchemy foreign key support when you try to get deletes to cascade.

Here's a typical parent/child relationship. As coded, deleting a parent cascades to its children. (Since we're using SQLite3, we need to intervene to enable foreign key support, but that's an extraneous detail here. The Flask bits are due to this being extracted from a larger app.)

As coded you can't ask a parent for its children. For that, you need to enable one of (1) or (2). Form (1) appears in