Skip to content

Instantly share code, notes, and snippets.

View 0xgdr's full-sized avatar
:copilot:

Gareth 0xgdr

:copilot:
View GitHub Profile
@0xgdr
0xgdr / javascript.js
Created November 23, 2012 13:30 — forked from jamiepittock/ExpressionEngine template
Inject events from low_events:entries into low_events:calendar cells
$(".event").each(function() {
// get the ID of the event element
var the_date = $(this).attr("id");
// find the tabel cell with that same ID and append the div
$(this).clone().appendTo('.calendar td#' + the_date);
});
{embed="_wrappers/_main"}
{exp:stash:set name='bodyId'}{segment_1}{/exp:stash:set}
{exp:stash:set parse_tags="yes"}
{stash:mainContent}
<h2>Articles</h2>
<ol class="posts">
{embed="_wrappers/_main"}
{exp:stash:set name='bodyId'}{segment_1}{/exp:stash:set}
{exp:stash:set name="mainContent"}
{exp:channel:entries channel="news_articles" disable="{gv_disableAll}"}
<article id="singlePost">
<h2>{title}</h2>
{if subtitle}
@0xgdr
0xgdr / script.js
Created December 15, 2012 21:31
Lesson from Treehouse, using jquery.
function isValidEmail(email) {
return email.indexOf("@") != -1;
}
// get all the inputs with the class of required
var $required = $('.required');
function requiredValues() {
var $values = new Array();
$required.each(function() {
@0xgdr
0xgdr / disqus.php
Created January 11, 2013 13:42
Disqus Plugin Working Code
<?php
class Plugin_disqus extends Plugin {
var $meta = array(
'name' => 'Disqus',
'version' => '0.9',
'author' => 'Mubashar Iqbal',
'author_url' => 'http://mubashariqbal.com'
);
@0xgdr
0xgdr / fields
Last active December 11, 2015 04:29
Statamic example fields.
type: date # see http://statamic.com/docs/control-panel/fieldsets#fieldsets-and-entries
hide: yes # hide page from Add Page list
fields:
categories:
display: Categories
required: false
type: tags
tags: # the template tag name -- in this example, {{ tags }}
display: Tags # the control panel field label (optional)
@0xgdr
0xgdr / kitchen-sink.md
Created January 19, 2013 08:36
This is the kitchen sink, all the common html elements laid out for you to add styling, really helpful to make sure you don't miss any styles, just copy and paste into a page in your _content folder.

Heading Level 1

Heading Level 2

Heading Level 3

Heading Level 4

Heading Level 5
Heading Level 6

A Paragraph

This is a paragraph of text which has all the most common html elements in it such as the strong element which is used to give text strong importance. You could of course use the b element which represents a span of text stylistically different from normal text, without conveying any special importance or relevance. The mark element which represents highlighted text, i.e., a run of text marked for reference purposes. The HTML em element marks text that has stress emphasis. You could of course use the i element which represents a range of text that is set off from the normal text for some reason, for example, technical terms, foreign language phrases, or fictional character thoughts. It is typically displayed in italic type. The next piece of text is marked up using the code element function() and finally links will be styled [lik

@0xgdr
0xgdr / gallery.yaml
Created January 29, 2013 05:33
Fields used to create a simple gallery in Statamic.
@0xgdr
0xgdr / gallery.html
Last active December 11, 2015 21:28
Some simple html and Statamic tags to render a gallery of images.
@0xgdr
0xgdr / gallery.yaml
Created January 29, 2013 07:03
Simple Statamic gallery with the content field hidden.