Skip to content

Instantly share code, notes, and snippets.

View rayrinaldy's full-sized avatar
🐶

Ray Rinaldy rayrinaldy

🐶
View GitHub Profile
git rm -r --cached .
git add .
@rayrinaldy
rayrinaldy / compress.py
Created October 30, 2018 02:49
Image Compression with Python
#!/usr/bin/env python
# Author: Ray Rinaldy
# pip install Pillow
# put this script in every image folder that wants to be converted
# run python compress.py
#
# This script will works on .jpg, .jpeg & .png (for png files, it will auto convert to have white background)
import os, glob, PIL, sys
@rayrinaldy
rayrinaldy / gist:4d93bf6e914e46c48c95a052c274ab99
Created August 13, 2019 03:59
Trigger 500 Error in Laravel
\App::abort(500, 'What you want to message');
@rayrinaldy
rayrinaldy / group.js
Last active December 2, 2019 15:49
Mongo Aggregate Data Grouping - Group and Sort by Date - Paginate
db.getCollection('videos').aggregate([{
'$group': {
'_id': {
month: {
'$month': '$date'
},
year: {
'$year': '$date'
},
dayOfMonth: {