Skip to content

Instantly share code, notes, and snippets.

View techniq's full-sized avatar

Sean Lynch techniq

View GitHub Profile
@techniq
techniq / README.md
Last active August 29, 2015 14:19
Gerber / KiCAD layer file extensions
KiCAD Layer Name Gerber Name Gerber Extension
F.Cu Top Layer .gtl
B.Cu Bottom Layer .gbl
F.Paste Top Paste .gtp
F.SilkS Top Overlay (silk screen) .gto
B.SilkS Bottom Overlay (silk screen) .gbo
F.Mask Top Solder Resist .gts
B.Mask Bottom Solder Resist .gbs
Edge.Cuts Edges (board outline) .gm1
@techniq
techniq / README.md
Last active August 29, 2015 14:22
Bash tips

Bash tips

Strip extension (source)

Example: foo.png => foo

for file in *.png; do
    echo $(basename $file .png)
done;

or

@techniq
techniq / fakeServer-test.js
Created June 14, 2015 02:05
Sinon AJAX tests
import JSData from 'js-data';
import DSHttpAdapter from 'js-data-http';
import sinon from 'sinon';
describe("fakeServer", function() {
beforeEach(function() {
this.server = sinon.fakeServer.create();
// this.server.autoRespond = true;
// this.respondImmediately = true;
@techniq
techniq / examples.js
Last active August 29, 2015 14:24
Find all elements with a specific style attribute
getElementsWithStyle('border.*radius');
getElementsWithStyle('box-shadow');
@techniq
techniq / getimageinfo.py
Created August 23, 2012 13:12
Get Image Info
import StringIO
import struct
def getImageInfo(data):
data = str(data)
size = len(data)
height = -1
width = -1
content_type = ''
@techniq
techniq / formview.py
Created August 23, 2012 14:19
FormView
from google.appengine.ext import db
from flask import flash, url_for, redirect, request
from flask.views import View
from flaskext.wtf import Form
from wtforms.ext.appengine.db import model_form
from application.decorators import templated
@techniq
techniq / simple-echo-server.py
Created August 23, 2012 15:12
Simple Echo Server
#!/usr/bin/env python
"""
A simple echo server
"""
import socket
host = ''
port = 50000
@techniq
techniq / set_dns.bat
Created September 12, 2012 02:07
Set Windows DNS Server
@ECHO OFF
set DNS_IP=
set /P DNS_IP=DNS server ip address: %=%
echo Setting DNS server...
netsh interface ip set dns "Local Area Connection 9" static %DNS_IP%
@techniq
techniq / base.html
Created November 13, 2012 14:47
Flask-Admin WTForms boostrap-wysihtml5
<!DOCTYPE html>
<html lang="en">
<head><script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script>
<link href='/static/bootstrap/css/bootstrap.css' rel='stylesheet' type='text/css' />
<link href='/static/wysihtml5/bootstrap-wysihtml5.css' rel='stylesheet' type='text/css' />
</head>
<body>
...
<script src="/static/wysihtml5/wysihtml5-0.3.0.min.js"></script>
@techniq
techniq / database.py
Created November 19, 2012 19:23
Flask-Script with fixture example
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager, prompt_bool
import application.models
db = SQLAlchemy()
manager = Manager("Perform database operations")
@manager.command
def drop():