Skip to content

Instantly share code, notes, and snippets.

View lighteternal's full-sized avatar

Dimitris Papadopoulos lighteternal

View GitHub Profile
@lighteternal
lighteternal / gist:8d8494261cf92a6755cb7563b691eff5
Last active April 23, 2023 15:35
Compress images to ~100kb
import os
from PIL import Image
import shutil
import io
def get_image_size(image, quality=95):
buffer = io.BytesIO()
image.save(buffer, format='JPEG', optimize=True, quality=quality)
return len(buffer.getvalue()) // 1024
@lighteternal
lighteternal / index.html
Created March 11, 2017 18:35
JS Bin Basic AngularJS: List, New, Delete, Edit, Read // source https://jsbin.com/dojeqag
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Basic AngularJS: List, New, Delete, Edit, Read">
<script src="https://rawgit.com/angular/bower-angular/master/angular.min.js"></script>
<script src="https://rawgit.com/angular/bower-angular-route/master/angular-route.min.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>