Skip to content

Instantly share code, notes, and snippets.

View gist:3d308df705abfa3111c31b63879c6999
If (status.contains('Nominee') && status != 'Nominee-No') {
Application_Stage = 'nominee';
switch on status {
when 'Nominee-No Show' {
status = 'Student did not attend Posse interview';
} when 'Nominee - Declined Invite' {
status = 'Student declined Posse interview';
@keithmancuso
keithmancuso / Stylefile.yml
Last active Aug 3, 2018
Customizations for 127.0.0.1 via StyleURL.
View Stylefile.yml
---
version: 1.0
domains:
- 127.0.0.1
url_patterns:
- 127.0.0.1/*
timestamp: '2018-08-03T15:55:26Z'
id: vAg8
redirect_url: http://127.0.0.1:8080/careers/
shared_via: StyleURL - (https://www.styleurl.app) import and export CSS changes from
@keithmancuso
keithmancuso / Stylefile.yml
Created Aug 2, 2018
Customizations for 127.0.0.1 via StyleURL.
View Stylefile.yml
---
version: 1.0
domains:
- 127.0.0.1
url_patterns:
- 127.0.0.1/*
timestamp: '2018-08-02T20:26:11Z'
id: fqAA
redirect_url: http://127.0.0.1:8080/
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome
@keithmancuso
keithmancuso / gist:7e4e96568e3edd333fa1e80fe1d551d9
Created Feb 24, 2018
download and unzip craft app folder
View gist:7e4e96568e3edd333fa1e80fe1d551d9
curl -L http://craftcms.com/latest.zip?accept_license=yes > craft.zip
unzip craft.zip -d .tmp
rsync -r .tmp/craft/app craft
rm -R .tmp
mkdir -p craft/storage
rm craft.zip
View atomic deployment on buddy
if [ -d "releases/${execution.to_revision.revision}" ] && [ "${execution.refresh}" = "true" ]; then echo "Removing: releases/${execution.to_revision.revision}" && rm -rf releases/${execution.to_revision.revision}; fi
if [ ! -d "releases/${execution.to_revision.revision}" ]; then echo "Creating: releases/${execution.to_revision.revision}" && cp -dR deploy-cache releases/${execution.to_revision.revision}; fi
echo "Linking current to revision: ${execution.to_revision.revision}"
rm -f current
ln -s releases/${execution.to_revision.revision} current
echo "Removing old releases"
cd releases && ls -t | tail -n +11 | xargs rm -rf
View gist:24c5c2adf1db4fcdce6d4cae02e8ab59
public PageReference nominate()
{
try {
// check to see if anyone else has already nominated someone with this email addres in this same year
Application__c application = [select Id from Application__c where Nomination_Round__r.Grant_Round__c = :NominationRound.Grant_Round__c and email__c = :newapplicant.Email__c limit 1];
// if so make a second instead of an application
Second__c Second = new Second__c();
View gist:9539cafab1bb3ea45dada8546f31c9c5
PageReference pdf = Page.PrintSet;
pdf.getParameters().put('id',customerId);
pdf.setRedirect(true);
// Take the PDF contents
Blob b = pdf.getContent();
// Create the email attachment
Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
View gist:99d97755a867db691e708d4410a948cf
{% set classIds = craft.calendar.events({ loadOccurrences: false, dateRangeStart: today }).relatedTo( category ).ids() %}
{% for id in classIds %}
{% set event = craft.calendar.event(id, {
occurrenceRangeStart: "today",
occurrenceRangeEnd: "6 months",
occurrenceLimit: 1
}) %}
View gist:d6170bd62bdff45e0adc68c9e324b5a6
{% spaceless %}
{% set d = craft.request.getParam('d') %}
{% set date = d ? d : 'today' %}
{% set month = craft.calendar.month({
date: date,
eventType: 'not spaceRental',
order: 'eventType desc',
@keithmancuso
keithmancuso / gist:b37d728c50e60f1390df5df66b4a3696
Created Jul 10, 2016
Default SEOMatic tags for layout file
View gist:b37d728c50e60f1390df5df66b4a3696
{% set seomaticMeta = {
seoTitle: seoTitle ?? seomaticMeta.seoTitle,
seoDescription: seoDescription ?? seomaticMeta.seoDescription,
seoKeywords: seomaticMeta.seoKeywords,
seoImage: seoImage ?? seomaticMeta.seoImage,
canonicalUrl: canonicalUrl ?? seomaticMeta.canonicalUrl,
twitter: {
card: seomaticMeta.twitter.card,
site: seomaticMeta.twitter.site,
creator: seomaticMeta.twitter.creator,