Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is a simple script to invite users to your slack | |
* Replace the subdomain and token in the variables below. | |
* Upload a logo called "logo.png" to the same directory for your group | |
* Upload a logo called "slack.png" to the same directory for slack | |
*/ | |
define('SUBDOMAIN','{YOUR SUBDOMAIN HERE}'); | |
define('TOKEN','{YOUR API TOKEN HERE}'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set cssupdate = '20150309' %} | |
{% if _cookie.csscached == cssupdate %} | |
<link rel="stylesheet" href="/css/global-min.{{ cssupdate }}.css"> | |
{% else %} | |
<style> | |
{% include 'global/critical.css' %} | |
</style> | |
<script> | |
(function (win, doc) { | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="module__image image--lazy" | |
data-image-src="Tim-Smith_220x140_220_140_int_c1.jpg"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::filter('stripe.plans.free', function() { | |
if (Auth::guest() || Auth::user()->subscribed()) { | |
return; | |
} | |
$user = Auth::user(); | |
$chosenPlan = 'free'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FacebookDebugger | |
{ | |
/* | |
* https://developers.facebook.com/docs/opengraph/using-objects | |
* | |
* Updating Objects | |
* | |
* When an action is published, or a Like button pointing to the object clicked, | |
* Facebook will 'scrape' the HTML page of the object and read the meta tags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Import a remote database into a local database | |
# ---------------------------------------------- | |
# | |
# Based on http://danherd.net/quick-script-synchronise-from-a-remote-expressionengine-database/ | |
# | |
# Don’t forget chmod +x to make the script executable. | |
# | |
# Change the extension to .command to run the script directly from OS X Finder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* find the n closest locations | |
* @param Model $query eloquent model | |
* @param float $lat latitude of the point of interest | |
* @param float $lng longitude of the point of interest | |
* @param float $max_distance distance in miles or km | |
* @param string $units miles or kilometers | |
* @param Array $fiels to return | |
* @return array |
When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.
Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008
…………………………
NewerOlder