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 / calendar.twig
Last active June 23, 2022 12:51
Venti custom calendar output via Twig Helper.
{# Array of months withing a specific month and year #}
{% set events = craft.venti.allEvents().startDate('and', '>= ' ~ prevMonth, '<= ' ~ nextMonth).find() %}
{# Parameters needed for calender output. Venti Events, Month, Year #}
{% set params = { "events": events, "month": currentMonth, "year": currentYear } %}
{% calendar params as days %}
<div>
<table>
<thead>
<tr>
{% for item in calendar.head %}
@a-am
a-am / gulpfile.js
Created November 3, 2015 22:31
Gulp starter file to concat and minify javascript files
/*
* Gulp install plugins
* @package.json
*/
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
$ = gulpLoadPlugins();
/*
@a-am
a-am / package.json
Created November 3, 2015 22:29
Package.json file for NPM components
{
"name": "gulp",
"version": "0.0.1",
"author": "Author Name",
"devDependencies": {
"gulp": "^3.9.0",
"gulp-bower-mf": "^0.4.1",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.6.0",
"gulp-jshint": "^1.5.1",
@a-am
a-am / toggle-remote-styles.js
Created October 8, 2015 17:53 — forked from gauntface/toggle-remote-styles.js
A book marklet to toggle styles.
javascript:(function(){var styles = document.querySelectorAll('link[rel=\'stylesheet\']'); for (var s = 0; s < styles.length; s++) {styles[s].mediax = styles[s].media;if (styles[s].media === 'only x') { styles[s].media = styles[s].mediax; } else if (styles[s].media !== 'print') {styles[s].media = 'only x';}}})();
{% set bread = craft.entries({ section: 'bread' }).limit(null) %}
{#
# Users with bread on 3 days
#}
{% set users3Days = craft.users({
group: 'customers',
relatedTo: [
'and',
{ targetElement: bread, field: 'breadForMonday' },
@a-am
a-am / gulpfile.js
Created August 19, 2015 16:31
Gulp Start File
/*
* Gulp install plugins
* @package.json
*/
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
$ = gulpLoadPlugins(),
LessPluginAutoPrefix = require('less-plugin-autoprefix'),
autoprefix = new LessPluginAutoPrefix({ browsers: ["last 2 versions"] }),
filter = require('gulp-filter');
@a-am
a-am / SassMeister-input-HTML.haml
Created March 26, 2015 04:58
Generated by SassMeister.com.
.box-1
.box-2
.box-3
.box-4
@a-am
a-am / gist:e8e1d3dc0c3e35f0495d
Created October 28, 2014 21:05
Filtering entries on events plugin.
{# You can filter this way if not needing to focus on recurring events in a specific order. #}
{% craft.entries.section('events').order().limit() %}
{# Or filter in the loop of craft.Events because you have access to any of the other fields in the entry through the variable entry.#}
{% for event in craft.Events.getAllEvents() %}
if(event.entry.fieldName == 'whatever'){
@a-am
a-am / jsbin.burut.html
Last active August 29, 2015 14:07 — forked from mojaray2k/jsbin.burut.html
CSS only custom-styled select Todd Parker - Filament Group Inc. How this works: This styles a native select consistently cross-platform with only minimal CSS. The native select is then styled so it is essentially invisible (no appearance, border, bg) leaving only the select's text visible. There is a wrapper around the select that has the majori…
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
@a-am
a-am / Vagrantfile
Last active August 29, 2015 14:07
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "parallels/ubuntu-12.04"
config.vm.network :private_network, ip: "192.168.50.4"
config.vm.provision :shell, :path => "install.sh"