This is companion code to this guide.
This file contains hidden or 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
| [extensions] | |
| extdiff = | |
| fetch = | |
| rebase = | |
| mq = | |
| histedit = /usr/bin/histedit.py | |
| pager = | |
| transplant = | |
| graphlog = | |
| bookmarks = |
This file contains hidden or 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
| # ~/.gitconfig | |
| [branch] | |
| autosetupmerge = true | |
| [push] | |
| default = current | |
| [core] | |
| excludesfile = .gitignore |
This file contains hidden or 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
| Hojeee é mais uma segunda-feira, | |
| a patroa ta avisada, | |
| não tenho hora pra voltar. | |
| Vou pro bar com amigos, | |
| Entre uma cerveja e outra, | |
| não vejo a hora passar | |
| Conversa nerd, filosófica ou afiada | |
| o que importa é a cervejada |
This file contains hidden or 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 | |
| find . -name '*.CR2' -print0 | while read -r -d '' FILE | |
| do | |
| BASENAME=$(basename -s ".CR2" "$FILE") | |
| exiftool -b -previewImage -ext .CR2 -w .JPG "$FILE" | |
| exiftool -tagsFromFile "$FILE" "$BASENAME".JPG | |
| done |
This file contains hidden or 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
| import timeit | |
| t = timeit.Timer("v=sorted(d.items(), key=lambda x: x[1])[-1]", | |
| "d = {'a': 1000, 'b': 3000, 'c':100}") | |
| print t.timeit() | |
| # 1.648s | |
| t = timeit.Timer("v=max(d.iteritems(), key = operator.itemgetter(1))[0]", | |
| "import operator; d = {'a': 1000, 'b': 3000, 'c':100}") | |
| print t.timeit() |
This file contains hidden or 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
| # projectfoo/config/__init__.py | |
| from os import path | |
| ROOT_PATH = path.dirname(path.dirname(path.abspath(__file__))) | |
| DEBUG = True | |
| TEMPLATE_DEBUG = DEBUG |
This file contains hidden or 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
| %%% Run with 'escript app_deps.erl' | |
| %%% Change the path in filelib:wildcard/1 as required to capture all | |
| %%% your dependencies. | |
| %%% | |
| %%% Rectangular nodes will represent library apps (no processes involved) | |
| %%% and the circular nodes will represent regular apps. An arrow going from | |
| %%% 'A -> B' means 'A depends on B'. | |
| %%% | |
| %%% This script depends on graphviz being present on the system. | |
| -module(app_deps). |
This file contains hidden or 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
| """ | |
| Copyright (c) 2012 Zohaib Sibte Hassan | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
This file contains hidden or 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
| """ | |
| This fabric file makes setting up and deploying a django application much | |
| easier, but it does make a few assumptions. Namely that you're using Git, | |
| Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
| Django installed on your local machine and SSH installed on both the local | |
| machine and any servers you want to deploy to. | |
| _note that I've used the name project_name throughout this example. Replace | |
| this with whatever your project is called._ |
OlderNewer