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
| /* =================================================== | |
| * jQuery SelectAll plugin | |
| * =================================================== | |
| * @author: https://gist.github.com/Leegorous | |
| * @license: Licensed under the Apache License, Version 2.0 (the "License"), | |
| * see http://www.apache.org/licenses/LICENSE-2.0 | |
| * =================================================== | |
| * | |
| * Example: | |
| * |
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
| class ImageWithThumbnail(models.Model): | |
| name = models.CharField(max_length = 255) | |
| image = models.ImageField(upload_to=settings.UPLOAD_ROOT,max_length=500,blank=True,null=True) | |
| thumbnail = models.ImageField(upload_to=settings.UPLOAD_ROOT,max_length=500,blank=True,null=True) | |
| def create_thumbnail(self): | |
| # original code for this method came from | |
| # http://snipt.net/danfreak/generate-thumbnails-in-django-with-pil/ |
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 | |
| #script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/ | |
| #tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/ | |
| cd /usr/share/fonts/truetype/ | |
| #TODO: put validation if folder already exists | |
| sudo mkdir ttf-monaco |
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
| # Template fabric deployment file for deploying Git projects | |
| import datetime | |
| from fabric.api import local, run, sudo, env | |
| from fabric.colors import green, red | |
| from fabric.context_managers import cd, lcd | |
| from fabric.operations import put, prompt | |
| from fabconfig import * |
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
| from __future__ import with_statement | |
| from fabric.api import local, settings, abort, sudo, cd, env | |
| from fabric.context_managers import prefix | |
| from fabric.contrib.console import confirm | |
| code_dir = '/srv/garbagehost/garbagehost' | |
| virtualenv_name = 'garbagehost' | |
| env.sudo_prefix = "sudo -i -S -p '%(sudo_prompt)s' " % env |
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 os | |
| from fabric.api import * | |
| env.local_root=os.path.dirname(__file__) | |
| def deploy_github(): | |
| with lcd(env.local_root): | |
| local('git checkout master') | |
| commit = local('git log -1|grep commit', capture=True) |
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
| from fabric.api import * | |
| from fabric.utils import abort | |
| from fabric.contrib.project import rsync_project | |
| from fabric.contrib.files import exists | |
| env.hosts = ['[email protected]'] | |
| target_dir = '/var/www/igor.io' | |
| backup_dir = target_dir+'-backup' | |
| staging_dir = target_dir+'-staging' |
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 sys | |
| from fabric.colors import green, yellow | |
| from fabric.contrib.console import confirm | |
| from fabric.context_managers import cd, prefix | |
| from fabric.operations import prompt | |
| from fabric.api import run, local, env, sudo | |
| env.user = 'ubuntu' | |
| env.hosts = ['0.0.0.0'] #ip do ec2 | |
| env.app_path = '/home/seu-usuario-do-ec2/bomgusto' |
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
| from fabric.api import env | |
| from fabric.state import output | |
| from fabric.api import env, parallel | |
| from fabric.operations import put, run, prompt, local | |
| from fabric.utils import puts, abort | |
| from os import path | |
| # control output |
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
| # -*- coding: utf-8 -*- | |
| import os | |
| from django.db import models | |
| from django.utils.translation import ugettext_lazy as _ | |
| from django.contrib.auth.models import User | |
| from django.core.files.storage import FileSystemStorage | |
| from django.conf import settings |