Skip to content

Instantly share code, notes, and snippets.

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@sagarPakhrin
sagarPakhrin / nearby-coordinates.sql
Created January 12, 2021 08:56 — forked from statickidz/nearby-coordinates.sql
Ordering with SQL by nearest latitude & longitude coordinates (MySQL & SQLite)
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC
@sagarPakhrin
sagarPakhrin / webstoemp-gulpfile.js
Created March 17, 2019 21:10 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@sagarPakhrin
sagarPakhrin / blag_model.py
Created March 17, 2019 16:42 — forked from x86ed/blag_model.py
Django blog model
import urllib2
import mimetypes
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
class Category(models.Model):
name = models.CharField(max_length=32)
class Meta:
#!/usr/bin/env python
"""Script that I keep in a Git repository along with my dotfiles. In the
repository, the files don't have the dot prefix so I can see them more easily.
Running the script symlinks all the files to ~/.<filename>, checking allowing
you to cancel if the file exists.
"""
import os
import glob