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
| # Is also used to change details of an order, if needed. | |
| class NewOrChangeOrderForm(forms.Form): | |
| customer = forms.ModelChoiceField(queryset=Customer.objects.order_by('id'), empty_label='<choose>') | |
| # ... | |
| def __init__(self, *args, **kwargs): | |
| super(NewOrChangeOrderForm, self).__init__(*args, **kwargs) | |
| # Customise how we show customer name | |
| self.fields['customer'].label_from_instance = lambda obj: "%s (%s %s)" % (obj.name, obj.firstname, obj.lastname) if obj.nick else "%s %s" % (obj.firstname, obj.lastname) |
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
| {% get_current_language as LANGUAGE_CODE %} | |
| <div id="lang_section" class="float-right"> | |
| <form action="{% url 'set_language' %}" method="post" id="base-lang-form"> | |
| {% csrf_token %} | |
| <select name="language" id="base-lang-selector"> | |
| {% for lang in LANGUAGES %} | |
| <option value="{{ lang.0 }}"{% if lang.0 == LANGUAGE_CODE %} selected{% endif %}>{% trans lang.1 %}</option> | |
| {% endfor %} | |
| </select> | |
| </form> |
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
| {% extends "hv/base.html" %} | |
| {% load url from future %} | |
| {% block header %}Stencil border generator{% endblock %} | |
| {% block content %} | |
| <h2>Stencil border generator</h2> | |
| <form method="POST"> |
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
| M48 | |
| ;Layer_Color=9474304 | |
| ;FILE_FORMAT=2:5 | |
| INCH,LZ | |
| ;TYPE=PLATED | |
| T12F00S00C0.05906 | |
| % | |
| G90 | |
| G05 | |
| T12 |
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
| # Address model | |
| class AddressBook(models.Model): | |
| id = models.AutoField(primary_key=True, db_column="address_book_id") | |
| customer = models.ForeignKey(Customer, db_column='customers_id') | |
| gender = models.CharField(max_length=3, db_column="entry_gender") | |
| company = models.CharField(max_length=192, blank=True, db_column="entry_company") | |
| firstname = models.CharField(max_length=96, db_column="entry_firstname") | |
| lastname = models.CharField(max_length=96, db_column="entry_lastname") | |
| street = models.CharField(max_length=192, db_column="entry_street_address") |
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
| {% extends "my/base.html" %} | |
| {% load url from future %} | |
| {% block header %}My account{% endblock %} | |
| {% block content %} | |
| <h2>My account</h2> | |
| <p><small>Last login: {{ user.last_login|date:"DATE_FORMAT" }} Date joined: {{ user.date_joined|date:"DATE_FORMAT" }}</small></p> |
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
| #! /usr/bin/guile -s | |
| !# | |
| (define bbm | |
| (lambda (n) | |
| (cond [(= n 0) | |
| '(Benoit B Mandelbrot)] | |
| [else | |
| `(Benoit ,(bbm (- n 1)) Mandelbrot)]))) |
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 | |
| suitable_files0() | |
| { | |
| python3 -c 'import itertools,glob;f=itertools.chain.from_iterable(glob.glob("*.%s"%"".join(map(lambda c:"[%s%s]"%(c.lower(),c.upper())if c.isalpha()else c,ext)))for ext in "drl,dri,txt,cnc,gko,gbr,gol,out,gml,gm1,gm16,gt1,gto,gtp,gts,gtl,g1,gl1,gp1,g2l,gl2,gp2,g2,g3,g3l,gl3,gp3,gp4,gp5,gbo,gbp,gbs,gbl".split(","));print("\0".join(f), end="")' | |
| } | |
| echo "Which tool? (Enter to skip)" | |
| select tool in gerbv gerbview analysefiles takepic rezip nautilus shell CleanAndExit; do | |
| case $tool in |
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/env python | |
| # TODO: Check files, because often txt files contain text | |
| # TODO: mfgcode files | |
| import re | |
| import sys | |
| import subprocess | |
| import itertools | |
| import math |
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
| %global srcname lwqq | |
| %global rel 1 | |
| # %global _hardened_build 1 | |
| # TODO: Non master releases: https://fedoraproject.org/wiki/Packaging:NamingGuidelines#Snapshot_packages | |
| Name: %{srcname} | |
| Version: 0.6.0 | |
| Release: %{rel}%{?dist} | |
| Summary: Libraries for lwqq |