Skip to content

Instantly share code, notes, and snippets.

@zvineyard
zvineyard / example_vhost_file.txt
Created June 17, 2015 05:12
Example vhost file with SSL
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /home/yourdomain/public_html
<Directory />
Options None
AllowOverride None
Order Deny,Allow
Deny from all
@zvineyard
zvineyard / streams_entry_looping_example.html
Last active August 29, 2015 14:27
Stream Entry Looping PyroCMS
{{ streams:cycle stream="employement_positions" limit="1" where="`position_slug`='[segment_2]'" }}
{{ entries }}
{{ if description != "" }}
<h3>Description of Position</h3>
<p>{{ description }}</p>
{{ endif }}
{{ /entries }}
{{ /streams:cycle }}
<?php
require 'yahoo-finance-api/lib/YahooFinance/YahooFinance.php';
$yf = new YahooFinance;
$quote = json_decode($yf->getQuotes(array('IDA', 'MCEP', 'UWTI')));
?>
<table>
<tr>
@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
$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 / pyrocms-cheat-sheet.md
Last active February 13, 2018 17:24
PyroCMS 3 Cheat Sheet

Crop a photo from the top:

{{ field.image().fit(400, 400, null, 'top')|raw }}

layout: degree.njk
title: "Business"
id: 1
type: "Bachelor of Science"
categories:
- business
- finance
- accounting
contact:
name: "Chair, Department of Business"