This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in `ls -1`; do | |
echo $file; | |
convert -background white -gravity center $file -resize 1080x1080 -extent 1080x1080 i-$file | |
convert $file -crop 2x1@ i-$file | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
register = template.Library() | |
@register.filter | |
def cool_number(value, num_decimals=2): | |
""" | |
Django template filter to convert regular numbers to a | |
cool format (ie: 2K, 434.4K, 33M...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -tt | |
""" | |
Takes an screenshot (the user draws a rectangle to select the interesting area), scans the resulting image and copy the text to clipboard | |
- scrot (http://en.wikipedia.org/wiki/Scrot) | |
- readbot (`pip install readbot`) | |
- pyperclip (`pip install pyperclip`) | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase, RequestFactory | |
from django.views.generic import TemplateView | |
from ..lib.views import YourMixin | |
class YourMixinTest(TestCase): | |
''' | |
Tests context-data in a Django Mixin like a boss | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# Copyright 2013 Diego Navarro Mellén. All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without modification, are | |
# permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this list of | |
# conditions and the following disclaimer. | |
# |
OlderNewer