Skip to content

Instantly share code, notes, and snippets.

@keithmancuso
keithmancuso / migrate.php
Created June 17, 2016 22:12
Move Craft Content Between Element Types
<?php
namespace Craft;
// This file could be placed into your public_html folder and visited to import a cheese product.
$craft = require '../craft/app/bootstrap.php';
$craft->plugins->loadPlugins();
$criteria = craft()->elements->getCriteria(ElementType::Entry);
$criteria->section = 'books';
@keithmancuso
keithmancuso / php.ini
Last active March 17, 2016 21:07
Default php.ini for php 5
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@keithmancuso
keithmancuso / FamiliarHumans.txt
Last active December 10, 2017 14:53
Familiar Humans.txt
# humanstxt.org/
# The humans responsible & technology colophon
# TEAM
FAMILIAR - familiar-studio.com
Keith Mancuso -- Tech Partner
Carl Williamson -- Design Partner
Ian Crowther -- Design Partner
@keithmancuso
keithmancuso / redirect.conf
Created January 31, 2016 16:37
NGINX redirect
server {
listen 80;
server_name familiar.studio www.familiar-studio.com www.familiar.studio familiarstudio.com www.familiarstudio.com familiar.io familiar.is;
return 301 http://familiar-studio.com$request_uri;
}
@keithmancuso
keithmancuso / familiarASCII.txt
Last active January 31, 2016 16:31
Familiar ASCII Art
<!-- Site by Familiar
//////////////////////
//////////////////////
//////////////////////
///////
///////
///////
///////
///////
///////////////////////
public PageReference checkIfNotNominee() {
User theUser = GlobalVariables.getCurrentUser();
Coontact theContact = GlobalVariables.getCurrentContact(theUser);
if (theContact.RecordTypeId != RecordTypeConstant.nomineeContactRecordTypeId) {
PageReference page = System.Page.PosseCommunity;
page.setRedirect(true);
return page;
} else {
@keithmancuso
keithmancuso / The other way
Last active August 29, 2015 14:17
City switcher
{% set segments = craft.request.getSegments() %}
{% set newUrl = segments[2:segments|length] %}
{% set newUrl = city.slug ~ newUrl %}
<?php
namespace Craft;
class SalesforceController extends BaseController
{
private $scopes = array();
private $params = array();
public function actionGetStudents() {
return 'test this stuff out';
@keithmancuso
keithmancuso / gist:dd2c539dc85b4bc9736d
Last active August 29, 2015 14:07
Jquery initialize directive
app.directive ('modal', function() {
return {
replace: false,
link:function (scope, element, attrs) {
element.fitVids();
}
}
})
<form method="post" action="" id="login-form" accept-charset="UTF-8">
<input type="hidden" name="action" value="users/login">
<input type="hidden" name="redirect" value="{{redirect}}">
<div class="form-group">
<label for="email">Email</label>
<input id="email" type="text" name="loginName" class="form-control">
</div>