Skip to content

Instantly share code, notes, and snippets.

layout: degree.njk
title: "Business"
id: 1
type: "Bachelor of Science"
categories:
- business
- finance
- accounting
contact:
name: "Chair, Department of Business"
@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 }}

<?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 / 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>
@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 }}
@zvineyard
zvineyard / example_vhost_file.txt
Created June 17, 2015 05:12
Example vhost file with SSL
<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
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 / ssl_apache_config.txt
Created June 17, 2015 04:33
SSL Apache Config
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/yourdomain_com.crt
SSLCertificateKeyFile /etc/apache2/ssl/yourdomain_com.key
SSLCACertificateFile /etc/apache2/ssl/yourdomain_com.cer
ServerAdmin admin@yourdomain.com
ServerName www.yourdomain.com
DocumentRoot /var/www/yourdomain.com/public_html/
ErrorLog /var/www/yourdomain.com/logs/error.log
image original dimensions (???x???)
files/large/1
files/thumb/1/auto/auto
files/thumb/1/auto/auto/fill
files/thumb/1/auto/auto/fit
max default dimensions (100x100) with aspect ratio
files/thumb/1
@zvineyard
zvineyard / gist:6e2f4b1c8fe896fc0915
Last active August 29, 2015 14:06
Messenger Homepage HTML with Tag
<div class="grid_8 alpha">
<div class="posts">
{{ articles:preview limit="4" where="`messenger_issue`='summer_2014'" }}
<div class="post">
<h2><a href="story/{{ article_slug }}">{{ article_title }}</a></h2>
<div class="meta">
<p class="pub_date">{{ helper:date timestamp=article_created }}</p>
</div>
{{ if thumb_id }}