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
import logging | |
import os | |
import pilkit.processors | |
import sys | |
import getopt | |
from PIL import Image | |
from PIL import ImageDraw, ImageOps | |
from pilkit.processors import Transpose, Adjust | |
from pilkit.utils import save_image |
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
$('#grid').mixitup({ | |
onMixLoad: function(){ | |
var hash = window.location.hash; | |
var noHash=hash.replace("#",""); | |
if(hash){ | |
$('#grid').mixitup('filter', noHash); | |
} | |
} | |
}); |
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
var db = {} | |
var gf = _docs_flag_initialData['docs-seu'].replace('/edit','/formResponse'); | |
var labels = [...document.querySelectorAll('.freebirdFormviewerViewItemsItemItem')]; | |
var form = labels.forEach(function(elb,i){ | |
//find labelname | |
var labelname = elb.querySelector('.freebirdFormviewerViewItemsItemItemTitle'); | |
labelname = labelname.textContent; | |
db[labelname] = {}; |
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
from flask import Flask,render_template, render_template_string | |
from pprint import pprint | |
'''HTML JINJA TEMPLATE''' | |
# create a new test.html file with the jinjaTemplateString below to view the issue. | |
jinjaTemplateString = ''' | |
<html> <head></head> <body> <h1>Test template</h1> | |
{% push 'js' %} ABC {% endpush %} | |
{% push 'js' %} XYZ {% endpush %} |
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
This will format python datetime as a string to be used within jinja conditionals for comparing current date to article date using pelican app. | |
1. Create a file named jinjaext.py | |
2. paste the following snippet | |
def convertdate(datetime, format='%a-%d-%m-%Y'): | |
return datetime.date().strftime(format) | |
3. Add the following line to your config file |
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
var inputs = {}; | |
var poststr = []; | |
$('input[type="hidden"]').each(function(){ | |
var entryKey = $(this).attr('name'); | |
var entryValue = $(this).parent().find('input[type="text"],textarea').first().val(); | |
if(entryKey.indexOf('entry.') == false){ | |
console.log(entryKey); | |
inputs[entryKey] = entryValue; | |
poststr.push(encodeURIComponent(entryKey) + "=" + encodeURIComponent(entryValue)); |
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
{% if article.productvariations %} | |
{% for category_groups in article.productvariations.split('|') %} | |
{% for category in category_groups.split('=') %} | |
{% if loop.first %} | |
<h1>{{ category }}</h1> | |
{% else %} | |
<ul> | |
{% for list in category.split(',') %} | |
{% set itemvalues = list.split(':') %} | |
<li>{{ itemvalues[0] }} costs {{itemvalues [1]}} |
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
# What I am attempting to do is split each key value pair groups down into smaller key value pairs spliting each at specified characters i.e:("=" "," ":" "|" )..etc. the characters used are arbitrary | |
# Example: Markdown metadata looks like this. | |
Title: Demo Product | |
date: 9-19-2013 | |
productvariations: Sizes=Small:13.00,Med:33.00,Large:42.00|Colors=Red,Green,Blue | |
# We need to output the following as: |
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
PROJECTSITE=$(DROPBOX_DIR)/WEBSITE/PROJECT_site | |
PROJECTSTORE=$(DROPBOX_DIR)/WEBSITE/PROJECT_store | |
PROJECTSITE_OUTPUT=$(BASEDIR)/output/PROJECTsite | |
PROJECTSTORE_OUTPUT=$(BASEDIR)/output/PROJECTstore | |
SITECONFFILE=$(BASEDIR)/projectconf.py | |
STORECONFFILE=$(BASEDIR)/projectstoreconf.py | |
generate_site: | |
$(PELICAN) $(PROJECTSITE) -o $(PROJECTSITE_OUTPUT) -s $(SITECONFFILE) | |
generate_store: | |
$(PELICAN) $(PROJECTSTORE) -o $(PROJECTSTORE_OUTPUT) -s $(STORECONFFILE) |
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
CRMresponse = [{ | |
"Values": ["Arboretum Development Fund", "Arboretum", "University of Hyper\\Ontario Agricultural College\\Arboretum", "7b5ced38-53f1-412d-8a2a-98b947f086db", "", "Arboretum Development Fund", "7b5ced38-53f1-412d-8a2a-98b947f086db"] | |
}, { | |
"Values": ["Dean's Innovation Fund", "College of Arts", "University of Hyper\\College of Arts", "1ea85925-c4a9-4c3e-81f5-228b21ab1ec8", "Focuses on meeting the overall needs of the College of Arts.", "College of Arts Dean's Innovation Fund", "1ea85925-c4a9-4c3e-81f5-228b21ab1ec8"] | |
}, { | |
"Values": ["College of Arts Student Assistance", "College of Arts", "University of Hyper\\College of Arts", "bc17fa75-16c6-4c6a-876c-ef0ba284ec6f", "", "College of Arts Student Assistance", "bc17fa75-16c6-4c6a-876c-ef0ba284ec6f"] | |
}, { | |
"Values": ["CBS Highest Priority", "College of Biological Science", "University of Hyper\\College of Biological Science", "0e0863fd-92e3-40e7-a832-0ca0afdaf850", "", "CBS Highest Priority", "0e0863fd-92e3-40e7-a832-0ca0afdaf850"] | |
}, |
NewerOlder