Skip to content

Instantly share code, notes, and snippets.

View avirias's full-sized avatar
🎯
Focusing

Avinash Kumar avirias

🎯
Focusing
View GitHub Profile
@rigoneri
rigoneri / compress_s3_images.py
Created February 5, 2013 19:26
Simple python code to compress (jpeg/png) images uploaded to S3. In this use case I want to compress down all images that are over 500 KB down to 80% quality which brings the images down to about 100KB. Feel free to muck with the values.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from boto.s3.connection import S3Connection
from cStringIO import StringIO
from PIL import Image as pil
AWS_KEY = '[AWS KEY HERE]'
@amaembo
amaembo / MemoryTest.java
Created October 25, 2021 10:04
MemoryTest sample
import java.util.ArrayList;
public class MemoryTest {
public static void main(String[] args) {
var processors = new ArrayList<Processor>();
for (int i = 0; i < 1000; i++) {
int[] data = new int[10_000_000];
processors.add(new Processor(data) {
@Override
int calculate() {