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 PIL import Image | |
backgroundColor = (0,)*3 | |
pixelSize = 9 | |
image = Image.open('input.png') | |
image = image.resize((image.size[0]/pixelSize, image.size[1]/pixelSize), Image.NEAREST) | |
image = image.resize((image.size[0]*pixelSize, image.size[1]*pixelSize), Image.NEAREST) | |
pixel = image.load() |
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 | |
import sys | |
class Tee(object): | |
""" | |
Allow forking of output to stdout and other files | |
From: http://stackoverflow.com/questions/11325019/output-on-the-console-and-file-using-python | |
@author Thrustmaster <http://stackoverflow.com/users/227884/thrustmaster> | |
@author Eric Cousineau <[email protected]> | |
""" |
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
# -*- coding: utf-8 -*- | |
#Copyright (C) 2013 Seán Hayes | |
import my_project.settings as dj_settings | |
from fabric.api import local, run, sudo, env, prompt, settings, cd, parallel, execute | |
from fabric.contrib.files import exists | |
from fabric.decorators import hosts, roles, runs_once | |
import json | |
import logging | |
import os |
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
# Notes on reviewing a replay: | |
#Use this to dig into the replay info: | |
https://github.com/evido/wotreplay-parser | |
#Installed the tool here (from windows command prompt): | |
cd C:\Games\World_of_Tanks | |
#Ran it like this: | |
mkdir wotreplay-parser_output | |
#create all the maps: | |
wotreplay-parser.exe --output wotreplay-parser_output --create-minimaps | |
wotreplay-parser.exe --parse --root . --output wotreplay-parser_output/replay_last_battle.wotreplay.png --type png --input replays/replay_last_battle.wotreplay |
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
# Do you like python named parameters (kvargs) ? | |
# Well, you can have it in bash too!! (but unfortunatly this will not allow you to mix positional and named parameters) | |
function myfunc() { local $*; echo "# foo=$foo, bar=$bar"; } | |
myfunc bar=world foo=hello | |
# foo=hello, bar=world | |
######### | |
# And with default arguments: |