Skip to content

Instantly share code, notes, and snippets.

View a-am's full-sized avatar

Adam Randlett a-am

View GitHub Profile
@a-am
a-am / index.html
Created August 8, 2012 15:55
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@a-am
a-am / index.html
Created August 8, 2012 15:55
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@a-am
a-am / index.html
Created August 8, 2012 15:55
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@a-am
a-am / gist:5052403
Last active December 14, 2015 07:39
Skeleton
$(document).ready(function(){
window.Site = {};
window.Home = {};
Site = {
init:function(){
Site.search();
@a-am
a-am / gist:5066800
Last active December 14, 2015 09:39
<?
require($_SERVER["DOCUMENT_ROOT"]."/monkcms.php");
header('Content-type: application/json');
$outarray;
$nodes;
$json;
//doesn't get you a event that is currently happening we need to use yesterday day with startdate and enable past to account for events currently happening.
$yesterday = date('n/j/y', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y")));
$today = date();
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
{% set allEvents = craft.entries.section('events').find() %}
{% set futureEvents = [] %}
{% for event in allEvents %}
{% if event.startDate | date('U') >= 'now' | date('U') %}
{% set futureEvents = futureEvents | merge([event]) %}
{% endif %}
{% endfor %}
{% for date, events in futureEvents | sortByField('startDate') | group('startDate|date("F Y")') %}
<?php
namespace Craft;
class SlugifyPlugin extends BasePlugin
{
public function getName()
{
return Craft::t('Slugify Twig Extension');
}
{% set allEvents = craft.entries.section('events').find() %}
{% set futureEvents = [] %}
{% for event in allEvents %}
{% if event.startDate | date('U') >= 'now' | date('U') %}
{% set futureEvents = futureEvents | merge([event]) %}
{% endif %}
{% endfor %}
{% for date, events in futureEvents | sortByField('startDate') | group('startDate|date("F Y")') %}
@a-am
a-am / demo.html
Last active August 29, 2015 14:06 — forked from zenlor/demo.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='lazyload.js'></script>
<style type='text/css'>