Skip to content

Instantly share code, notes, and snippets.

View MaxMorais's full-sized avatar
🏢
Building TechMax Soluções

Maxwell Morais MaxMorais

🏢
Building TechMax Soluções
View GitHub Profile
@MaxMorais
MaxMorais / flatten_wsdl.py
Created October 29, 2015 16:00 — forked from pavelpatrin/flatten_wsdl.py
Нерабочий вариант функции для схлопывания wsdl-схем
def _get_flatten_wsdl(self, url):
"""
Выполняет загрузку wsdl-схемы и зависимых файлов и объединяет их
в единый файл.
Ускоряет загрузку wsdl-схемы для клиента.
TODO: реализовать.
:type url: unicode
@MaxMorais
MaxMorais / gist:a066b2350ed2f7c28c2b
Created October 3, 2015 04:16 — forked from nanonyme/gist:6268358
brainstorming on suds + python-requests thinamabob, MIT-licensed
from suds.transport import Transport, Reply
from suds.client import Client
import requests
from StringIO import StringIO
class RequestsTransport(Transport):
def open(self, request):
""" suds assumes urllib2 which doesn't have keepalives so things can go royally wrong if it doesn't
read the entire request. Hence, read it all up and give a StringIO object instead.
vagrant@vagrant-ubuntu-trusty-64:~/frappe-bench$ bench use argentina
vagrant@vagrant-ubuntu-trusty-64:~/frappe-bench$ bench migrate
Migrating argentina
Updating frappe : [========================================]
Updating erpnext : [========================================]
Updating argentina : [========================================]
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
Usage: [OPTIONS] COMMAND [ARGS]...
Bench manager for Frappe
Options:
--help Show this message and exit.
Commands:
backup backup site
backup-all-sites backup all sites
@MaxMorais
MaxMorais / 0-README.md
Last active August 29, 2015 14:26
ERPNext setup with Salad

First how it works

ERPNext automated Setup

What is Salad

Salad, is test automation tool, designed on top of Lettuce, to do tests using files that contains the description of each task, these files are named features

Setuping your environment

@MaxMorais
MaxMorais / DE.py
Last active August 29, 2015 14:26 — forked from jumbojet/DE.py
Dynamic Expression Parsing
''' expressionString = IF Variable_3 > 1000 RETURN VARIABLE_3* VARIABLE_1 END IF Variable_3 < 1000 RETURN VARIABLE_3* VARIABLE_2 END '''
def parse_expression(expressionString):
expressionStringArray = filter(None,expressionString.split("END"))
''' expressionStringArray[0] = IF Variable_3 > 1000 RETURN VARIABLE_3* VARIABLE_1
expressionStringArray[1] = IF Variable_3 < 1000 RETURN VARIABLE_3* VARIABLE_2 '''
for expression in expressionStringArray:
expConditionResult = expression.strip().split("RETURN")
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
},YlGnBu: {
{%- macro add_header(page_num, max_pages, doc) -%}
{%- if doc.meta.is_submittable and doc.docstatus==2-%}
<div class="alert alert-danger text-center">
<h4 style="margin: 0px;">{{ _("CANCELLED") }}</h4></div>
{%- endif -%}
{% if max_pages > 1 %}
<p class="text-right">{{ _("Page #{0} of {1}").format(page_num, max_pages) }}</p>
{% endif %}
{%- endmacro -%}
<style>
table.black {
background-color: #000 !important;
height: 1px;
width: 100%;
}
table.black > tr > td {
color: white;
.panel {
overflow: hidden;
text-align: left;
margin: 0;
border: 0;
-moz-border-radius: 0 0 0 0;
-webkit-border-radius: 0 0 0 0;
border-radius: 0 0 0 0;
}
.panel-header,