Skip to content

Instantly share code, notes, and snippets.

View rorist's full-sized avatar

Aubort Jean-Baptiste rorist

View GitHub Profile
@rorist
rorist / resizeForAndroid.py
Created September 13, 2012 16:10 — forked from corbett/resizeForAndroid.py
resize images for Android
import os
import glob
from PIL import Image
from math import ceil
xhdpi2hdpi=0.75
hdpi2mdpi=2/3.
mdpi2ldpi=0.75
for asset in glob.glob('drawable-xhdpi/*png'):
img = Image.open(asset)
xhdpi = img.size
#!/usr/bin/env python
import socket
import sys
if len(sys.argv) != 3:
print "Usage: %s host:port destfile.jpg" % sys.argv[0]
sys.exit(1)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host, port = sys.argv[1].split(':')
@rorist
rorist / pedantically_commented_playbook.yml
Created January 18, 2016 08:53 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.