Skip to content

Instantly share code, notes, and snippets.

View jkotra's full-sized avatar
🎯
Focusing

Jagadeesh Kotra jkotra

🎯
Focusing
View GitHub Profile
@ovelny
ovelny / timeshift-archlinux-fix.md
Last active March 8, 2024 19:21
Fix for scheduled backups with Timeshift and Arch Linux

Issue

If you installed Timeshift from the AUR package (https://aur.archlinux.org/packages/timeshift/), you'll find that scheduled backups may not work. This is due to cronie being disabled by default.

Fix

Check if cronie is present first:

systemctl list-unit-files | grep cronie
@ed-flanagan
ed-flanagan / geo_distance.cpp
Last active May 22, 2020 13:24
Great-circle distance computational forumlas in C++
/*
* Great-circle distance computational forumlas
*
* https://en.wikipedia.org/wiki/Great-circle_distance
*/
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <cmath>
@mattjmorrison
mattjmorrison / crop_and_resize.py
Created April 20, 2011 19:03
Resize and Crop images with Python and PIL
from PIL import Image, ImageChops
def trim(im, border):
bg = Image.new(im.mode, im.size, border)
diff = ImageChops.difference(im, bg)
bbox = diff.getbbox()
if bbox:
return im.crop(bbox)
def create_thumbnail(path, size):