Skip to content

Instantly share code, notes, and snippets.

View absentbird's full-sized avatar

Shawn Bird absentbird

View GitHub Profile
package main
import (
"fmt"
"time"
)
func main() {
o := new(Order)
o.arrival, _ = time.Parse(DATE_FORMAT, "2014-11-24")
@absentbird
absentbird / holiday-swag.md
Last active August 29, 2015 14:06
How To Make a Holiday Swag Script

#VIDEO SCRIPTS:

##How-To Make a Holiday Swag

To make a holiday swag you will need four of the five varieties of greens from the case of Assorted Boughs. Shown from left to right select
1 bough of Noble fir or Silver (The Silver is not shown).
1 branch of Port Orford cedar
1 branch of Princess pine
And 1 branch of Blue berried Juniper
Other supplies can be purchased from most craft stores or floral supply stores. Those supplies should include;

@absentbird
absentbird / The Little Guide To Beating Procrastination.md
Last active July 12, 2017 05:57
The Little Guide To Beating Procrastination, Perfectionism and Blocks: A Manual for Artists, Activists, Entrepreneurs, Academics and Other Ambitious Dreamers
import yaml
class Piece:
name = ''
move_type = []
# ... more code goes here
def move_type(self):
if not self.move_type:
---
teams:
white:
symbol: w
qualities:
- first_move
black:
symbol: b
qualities:
- y_reversed
@absentbird
absentbird / complexloop.py
Created November 19, 2013 04:28
Counts the number of items sold and returns data for a report.
# The dictionary that will be filled by the loop
taxable_orders = {}
# Totals to be included with the report
taxable_summery = {}
taxable_summary['Order Numbers'] = [x.order_num for x in taxable]
taxable_summary['Total Sales'] = sum([x.price for x in taxable])
taxable_summary['Total Tax'] = sum([x.tax for x in taxable])
taxable_summary['Total Freight'] = sum([x.freight for x in taxable])
taxable_summary['Grand Total'] = [x.price + x.tax + x.freight for x in taxable]
def get_orders(start, end, limit=None):
if limit:
ch_orders = CH_Order.query.filter(and_(CH_Order.timeAdded > start), (CH_Order.timeAdded <= end)).order_by(desc(CH_Order.poNumber)).limit(limit)
else:
ch_orders = CH_Order.query.filter(and_(CH_Order.timeAdded > start), (CH_Order.timeAdded <= end)).order_by(desc(CH_Order.poNumber))
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from connection import uri
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = uri['ch']
db = SQLAlchemy(app)
Traceback (most recent call last):
File ".\test.py", line 37, in test_batch
self.assertEquals(batch.messageCount, 14)
AttributeError: 'NoneType' object has no attribute 'messageCount'
@absentbird
absentbird / minimalflaskapp.py
Created May 9, 2013 22:36
A minimal flask app. Replace single hash (#) comments with your own code.
from flask import Flask
##import your script here
#import example
app = Flask(__name__)
@app.route('/')
def root():
##Run your script here
#output = example.function()
return output