Skip to content

Instantly share code, notes, and snippets.

View CapnKernel's full-sized avatar

Mitch Davis CapnKernel

  • Melbourne, Australia
View GitHub Profile
@CapnKernel
CapnKernel / stencil.py
Created April 7, 2015 09:33
Generating a stencil border
# -*- coding: utf-8 -*-
from decimal import Decimal
from copy import copy
from django.shortcuts import render
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import StencilBorderForm
@CapnKernel
CapnKernel / kicad-2014.11.15-turn-off-bzr-1.patch
Created January 28, 2015 23:42
A patch to stop the KiCad build from invoking bzr
--- kicad-2014.11.15/CMakeModules/download_boost.cmake.orig 2014-11-15 20:49:45.273560802 +1100
+++ kicad-2014.11.15/CMakeModules/download_boost.cmake 2014-11-15 21:10:25.008476029 +1100
@@ -203,17 +203,17 @@
# Revert the branch to pristine before applying patch sets as bzr patch
# fails when applying a patch to the branch twice and doesn't have a switch
# to ignore previously applied patches
- PATCH_COMMAND bzr revert
+ PATCH_COMMAND echo mock bzr revert
# bzr revert is insufficient to remove "added" files:
- COMMAND bzr clean-tree -q --force
#: templates/shipping/summary.html:6 templates/shipping/summary.html.py:10
msgid "Shipping: All orders"
msgstr "发货:所有的订单"
#: templates/shipping/summary.html:13
msgid "Enter tracking numbers"
msgstr "输入发货挂号"
# This class represents the once-per-order information.
class Order(models.Model):
id = models.AutoField(primary_key=True)
hash = models.CharField(max_length=hash_length, unique=True, editable=False)
customer = models.ForeignKey('Customer')
payment_method = models.CharField(max_length=384)
payment_module_code = models.CharField(max_length=96)
shipping_method = models.CharField(max_length=384)
shipping_module_code = models.CharField(max_length=96)
agent = models.ForeignKey(ShippingAgent, null=True, blank=True)
@CapnKernel
CapnKernel / order-arrived.html
Created January 7, 2015 02:46
A look at some code behind hackvana's /my facility
{% extends "my/base.html" %}
{% load url from future %}
{% load vinaigrette %}
{% load i18n %}
{% block header %}My order: {{ order.hash }}'s arrived!{% endblock %}
{% block content %}
<h2>My order: {{ order.hash }}</h2>
Me to rugged circuits:
--- 8< ----
Hello rugged individuals,
I'm a regular user of gerbmerge. You guys were responsible for
releasing version 1.8 of gerbmerge some 30 months ago. Thanks for
that!
I have source here for a gerbmerge which is a merge of your gerbmerge
#ifndef MODE_STENCIL
stencilmode = 0
roundededges = 0
#else
stencilmode = 1
roundededges = 5mm
#endif
# Toolholes for panel and stencil. (0 = no toolholes)
#if STYLE==naked
toolholediameter = 0
M48
INCH,TZ
T10C0.040
T11C0.035
%
T10
X056900Y018250G85X056100Y018250
X054500Y019100G85X054500Y019900
X056900Y020750G85X056100Y020750
T11
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import math, cmath
from cmath import phase, rect
# All dimensions in millimetres.
Description[en]="<b>Hackvana RS-274X Gerber/Excellon format CAM script for Eagle 2-layer boards</b><br>\n
<br>\n
This CAM job consists of 12 sections. Each section generates a Gerber/Excellon file.<br>\n
<br>\n
There are 12 sections, which creates 12 files:<br>\n
<br>\n
.gm1 Board Outline/unplated slots<br>\n
-Vcut.gbr V-score Lines<br>\n
.txt Plated Holes<br>\n
_NPTH.txt Non-plated Holes<br>\n