Skip to content

Instantly share code, notes, and snippets.

View gladson's full-sized avatar
😎
Vá lutar pelo que você acredita.

Gladson gladson

😎
Vá lutar pelo que você acredita.
View GitHub Profile
@gladson
gladson / instalacao-docker-e-docker-compose.md Instalação Simples - Docker & Docker Compose => Ubuntu

Instalação Simples - Docker & Docker Compose => Ubuntu ou Alpine

Ubuntu

  1. sh install-docker-ubuntu.sh
  2. log out
  3. log back in

Alpine

@gladson
gladson / duvida.dart
Last active June 29, 2019 01:35 — forked from henriquepinheiro84/gist:9069c6fee47842370d51345edf27e55b
Estou fazendo um modulo flutter em um app android no entanto não estou conseguindo enviar dados para o módulo. Alguém já passou por isso e conseguiu resolver?
import 'package:app_pratico_flutter_module/pages/nova_pagina.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:toast/toast.dart';
void main() {
// runApp(
// choseWidget(window.defaultRouteName),
// );
# -*- coding: utf-8 -*-
from django.template.defaultfilters import floatformat
from django.contrib.humanize.templatetags.humanize import intcomma
from django.utils.encoding import force_unicode
from django.template import Library
register = Library()
@register.filter(name='float_to_real')
from django import template
from django.db.models import Sum, Avg, Max, Min, Count
register = template.Library()
@register.filter
def sum(queryset, field):
return queryset.aggregate(sum_value=Sum(field)).get('sum_value')

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

{% load core_utils %}
<ul id="tags" class="nav nav-tabs nav-stacked">
{% for tag in tags %}
{% if tag_full_list|list_count:tag %}
<li>
<a href="{% url "post:posts-tagged-related" tag.slug %}">
{{ tag.name }} <span class="label label-info">{{ tag_full_list|list_count:tag }}</span>
</a>
</li>
from django.template.defaultfilters import slugify
class AutoSlugMixin(object):
"""
Automatically set slug to slugified version of the name if left empty.
Use this as follows::
class MyModel(AutoSlugMixin, models.Model):
def save(self):
super(MyModel, self).save()
# coding: utf-8
u"""
Redimensionamento proporcional de imagem, com base na altura, feito com um simples cálculo de proporção.
Ex:
+------+ 10 15 (altura desejada para a nova imagem)
| | -- x --
| 10x5 | 5 x (largura proporcional a nova altura)
| |
+------+ (10 x x) = (5 x 15)
10x = 75

Installing WeasyPrint on Windows

WeasyPrint converts HTML including images to PDF, it's cross platform but Windows requires a decent amount of massaging to persuade it to work.

To install Pango and Cairo download the [all in one bundle][GTK] of the GTK+ stack and extract the archive to C:\GTK.

You'll need to add the GTK bin folder to your system path so the various

<div class="control-group">
<label class="control-label">Location</label>
<div class="controls">
<input name="location" type="text" placeholder="City, State, Country" value="">
<input name="location_city" type="hidden" value="">
<input name="location_state" type="hidden" value="">
<input name="location_country" type="hidden" value="">
<input name="location_lat" type="hidden">
<input name="location_lng" type="hidden">
</div>