This file contains 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
def get_total_weight_in_oz(request, order_form): | |
# sort the shopping cart by skus so we can match it up with | |
# an actual queryset of product data (mostly for the weights) | |
cart_by_skus = sorted( request.cart , key=lambda item: item.sku ) | |
skus = [item.sku for item in cart_by_skus] | |
quantities = [item.quantity for item in cart_by_skus] | |
products = ProductVariation.objects.filter(product__sku__in=skus).order_by('sku') | |
discount = '' | |
discounted_products = '' |
This file contains 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
tell application "Google Chrome" | |
make new window | |
end tell | |
tell application "iTerm" | |
set myterm to (make new terminal) | |
tell myterm | |
set mysession to (make new session at the end of sessions) | |
tell mysession | |
exec command "/bin/bash -l" |
This file contains 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
├── Dockerfile | |
├── README.md | |
├── _gulp | |
│ ├── config.js | |
│ ├── tasks | |
│ └── util | |
├── app | |
│ ├── __init__.py | |
│ ├── __init__.pyc | |
│ ├── __pycache__ |
This file contains 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
# Copyright 2013 Thatcher Peskens | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains 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
function linkify($text) | |
{ | |
$text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', | |
'<a href="\\1">\\1</a>', $text); | |
$text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', | |
'\\1<a href="http://\\2">\\2</a>', $text); | |
$text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', | |
'<a href="mailto:\\1">\\1</a>', $text); |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" | |
extension-element-prefixes="date"> | |
<!-- | |
Description: | |
This is a date formatting utility. The named template "format-date" takes 2 parameters: | |
1. date - [required] takes an ISO date (2005-12-01T13:45:00) |
This file contains 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
au! BufWritePost .vimrc source % " automatically reload when editing .vimrc | |
" 4 spaces for tabs and automatically inherit previous line's indentation. | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set autoindent |
This file contains 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
Array | |
( | |
[0] => Array | |
( | |
[number] => 2 | |
[message] => XSLTProcessor::importStylesheet(): </xsl:template> | |
[file] => /Users/fox/Sites/mercytrials/symphony/lib/toolkit/class.xsltprocess.php | |
[line] => 145 | |
[type] => xsl | |
[context] => <?xml version="1.0" encoding="UTF-8"?> |
This file contains 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 | |
echo "creating project directory.." | |
mkdir $1 | |
cd $1 | |
git init | |
echo "downloading symphony files.." | |
git remote add core git://github.com/symphonycms/symphony-2.git | |
git pull core master |
This file contains 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
/* | |
* page functions are grouped by <body>'s class. | |
* all pages in a class fire init(). | |
* named functions are fired according to <body>'s id. | |
* hyphens are stripped from classes and ids automatically. | |
* | |
*/ | |
SUGAR = { |
OlderNewer