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
<?php
$url = 'https://astra.nnu.edu/AstraProd';
$responderUrl = "/~api/calendar/calendarList?action=get";
$responderParameter = 'fields=ActivityID,ActivityName,Description,SectionMeetInstanceByActivityId.SectionMeetingID,EventMeetingByActivityId.EventId,ParentActivityName,StartDate,EndDate,StartMinute,EndMinute,SectionMeetInstanceByActivityId.SectionMeeting.PrimaryInstructor.Person.ContactInformation.Email,SectionMeetInstanceByActivityId.SectionMeeting.PrimaryInstructor.Person.FirstName,SectionMeetInstanceByActivityId.SectionMeeting.PrimaryInstructor.Person.LastName,ActivityTypeCode,Location.Room.Id,BuildingCode,RoomNumber,LocationName,RoomName&filter=((StartDate>%3D"01%2F01%2F2017")%26%26(EndDate<"06%2F01%2F2017")%26%26(ActivityTypeCode=="251"))&sortOrder=StartDate&limit=1000&view=json';
$curl = curl_init();
@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();
@zvineyard
zvineyard / yahoo-finance-api-methods.php
Created November 8, 2015 04:54
A list of methods to use in the yahoo-finance-api php library.
<?php
getHistoricalData($symbol, $startDate, $endDate); // Returns json object of basic historical data
getHistoricalData( 'IDA', date('Y-m-d', strtotime('-14 days')), date('Y-m-d',time()) );
getQuotes($symbols); // Returns json object with comprehensive trade info for each stock
getQuotes(array('AAPL', 'GOOG'));
getQuotesList($symbols); // Returns a summarized view of getQuotes
getQuotesList(array('AAPL', 'GOOG'));
<?php
require 'yahoo-finance-api/lib/YahooFinance/YahooFinance.php';
$yf = new YahooFinance;
$quote = json_decode($yf->getQuotes(array('IDA', 'MCEP', 'UWTI')));
?>
<table>
<tr>