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 | |
namespace Deployer; | |
require 'recipe/composer.php'; | |
// Project name | |
set('application', 'my-project'); | |
// Project repository | |
set('repository', 'git@github.com:organization/repo.git'); |
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
{% comment %} | |
Set up `transform` string for inclusion in a URL: | |
{% endcomment %} | |
{% if size %} | |
{% assign transform = size | prepend: '_' %} | |
{% else %} | |
{% assign transform = '' %} | |
{% endif %} |
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
module.exports = (serializeArrayResult) -> | |
obj = {} | |
arr = serializeArrayResult | |
for pair in arr | |
if obj[pair.name] isnt undefined | |
if !Array.isArray obj[pair.name] | |
# Convert existing single value to an array: | |
obj[pair.name] = [obj[pair.name]] |
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
<? class CustomKirbyValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri | |
* @return void | |
*/ |
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
<? namespace Craft; | |
class SfscPlugin extends BasePlugin | |
{ | |
public function getName() | |
{ | |
return Craft::t('Event Attendance'); | |
} | |
public function getVersion() |
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
<? namespace Craft; | |
class HelpersPlugin extends BasePlugin | |
{ | |
public function getName() | |
{ | |
return Craft::t('Helpers'); | |
} | |
public function getVersion() |
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
<? namespace Craft; | |
# craft/plugins/helpers/HelpersPlugin.php | |
class HelpersPlugin extends BasePlugin | |
{ | |
public function getName() | |
{ | |
return Craft::t('Helpers'); | |
} |
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
getClass = (el) -> | |
if el.hasAttribute 'class' | |
el.getAttribute('class').split ' ' | |
else | |
[] | |
hasClass = (el, className) -> | |
-1 < getClass(el).indexOf className | |
addClass = (el, className) -> |
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
<? email::$services['mailgun-html'] = function($email) { | |
if(empty($email->options['key'])) throw new Error('Missing Mailgun API key'); | |
if(empty($email->options['domain'])) throw new Error('Missing Mailgun API domain'); | |
$url = 'https://api.mailgun.net/v2/' . $email->options['domain'] . '/messages'; | |
$auth = base64_encode('api:' . $email->options['key']); | |
$headers = array( | |
'Accept: application/json', |