Skip to content

Instantly share code, notes, and snippets.

@zvineyard
zvineyard / typo3_link_conversion_functions
Last active December 22, 2017 10:21
Typo3: Convert <link> to <a> Regex PHP
@zvineyard
zvineyard / cope_articles_pyrocms_tag
Last active August 29, 2015 13:57
PyroCMS Tag: Cope Articles
<div class="posts">
{{ articles:preview limit="2" }}
<div class="post" style="border:none;margin:0;">
<h2><a href="story/{{ article_slug }}">{{ article_title }}</a></h2>
<div class="meta">
<p class="pub_date">{{ helper:date timestamp=created }}</p>
</div>
{{ if thumb_id }}
@zvineyard
zvineyard / pyrocms_core_hacks
Last active August 29, 2015 13:56
PyroCMS Core Hacks
system/cms/core/Public_Controller.php, around line 103:
if($this->uri->segment(1) !== 'story')
{
$this->template->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
}
@zvineyard
zvineyard / PyroCMS: Multiple Relationship Streams Example
Last active August 29, 2015 13:56
A multiple relationship streams tag example for PyroCMS, using two streams to output data.
{{ streams:cycle stream="articles" namespace="cope" paginate="yes" pag_segment="2" limit="10" order_by="created" sort="desc" }}
<!--{{ total }} entries returned-->
<div>
{{ entries }}
<p>{{ title }}</p>
<p>
{{ streams:departments }}
@zvineyard
zvineyard / Typo3: Body Tag Class
Created January 21, 2014 22:16
Add class to body tag using TypoScript.
# Add class to body tag
page.bodyTag >
page.bodyTagCObject = TEXT
page.bodyTagCObject.value= industrial
page.bodyTagCObject.wrap = <body class="|">
@zvineyard
zvineyard / vagrant-bootstrap
Last active January 3, 2016 00:19
Vagrant (VirtualBox) bootstrap. Holla!
#!/usr/bin/env bash
# Upgrade Base Packages
sudo apt-get update
sudo apt-get upgrade -y
# Install Web Packages
sudo apt-get install -y apache2
rm -rf /var/www
ln -fs /vagrant /var/www
@zvineyard
zvineyard / nnu_youtube_embed.js
Last active December 20, 2015 09:09
JS: NNU Embed YouTube Video
<script>
var configYouTubePlayer = {
// The YouTube video ID that identifies the video that the player will load.
videoID: 'Rk6_hdRtJOE',
// The height of the video player. The default value is 390.
height: 390,
// The width of the video player. The default value is 640.
width: 640,
@zvineyard
zvineyard / nnu_undergrad_degrees.js
Created May 14, 2013 14:17
A JavaScript array of the undergraduate majors offered by NNU.
var majors = new Array(
"Accounting",
"Applied Studies",
"Art",
"Biblical Studies",
"Biology",
"Business Administration",
"Chemistry",
"Christian Ministry",
"Communication",
@zvineyard
zvineyard / nnu_grad_degrees.js
Last active December 17, 2015 07:58
A JavaScript array of the graduate degrees offered by NNU.
var grad_degrees = new Array(
"EDS - Director of Special Education: Exceptional Child",
"EDS - Dirirector of Special Education: Education Leadership",
"EDS - Educational Leadership: Superintendent",
"EDS - Educational Leadership: Building Administrator",
"EDD - Educational Leadership",
"MA - Christian Education",
"MA - Missional Leadership",
"MA - Pastoral Ministry",
"MA - Spiritual Formation",
@zvineyard
zvineyard / model.js
Created April 30, 2013 22:28
The basics of a custom Titanium model.
function Model() {
this.init = function() {
alert('model init');
}
}
module.exports = function() {
return new Model();