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 | |
#parse("PHP File Header.php") | |
class ${NAME} extends DataObject { | |
private static \$db = array(); | |
private static \$has_one = array(); | |
private static \$has_many = array(); |
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 | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
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
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAgAElEQVR4Xu2dC5RUxbX397yZ9wxvlaeiQYyPoAGyMKCY6+N+ENGrQFSMgSsmCx8k4ANFVESeIpFEicuIy0RFvTcmXIzGR0QUFRWVEDAQQUBEZIBhgAHm2fOtfzVn7Onpnu6ZOaenTu//WWvWwPTpOrVr79q/ql276qTU1dXVCS+2AFuALcAWYAuwBXzdAinxAL2iokKysrIkJSWlSWFra2ulurpa2rVr1+i+aGXg72lpaZKRkdHgO/g7rkhl+brFWXm2AFuALcAWYAt40AL1QMdEfcGCBXLddddJx44dzaO+/vprmTVrloE0YD5p0iTp27dvxGq899578tRTT5nPiouL5c4775SCgoKoZaDMuXPnyo4dO8x3Lr/8crnooosE9XjmmWfknXfeMX8/88wz5ec//7mkpqZ6ID6LZAuwBdgCbAG2QHK0gAH6rl27DMzLy8vlgQcekA4dOhiIT5kyRbp27Spjx441sAbgf/3rXzeaTe/cuVNmzJghw4YNk+9973uyaNEi6dmzpxkARCtj8eLFsmXLFrnlllvkww8/lBUrVsjUqVNl69at8vzzz8tPf/pTCQQC8oc//EFGjhwpl1xySXK0OKVgC7AF2AJsAbaABy2QEggE6iZPnmxm3mvXrjVgxgx906ZNsnDhQpkzZ44UFRVJWVmZ3HHHHQbQffr0aVCV//3f/5V3333XDAowk16zZo0sWbJEfvGLX8gjjzzSqIybbrpJHn30Ubn22mtl4MCBZlaOOgwdOlQ+/vhjOeGEE+SGG24wz0A5GDBMmzYtZsjfg/ZhkWwBtgBbgC3AFvBFC5gZ+uHDh81a9c033yz33XefAfpHH30kTz75pIExQudHjx41MMdsfdCgQQ2Ee+KJJ2T79u1y7733GqBv3LjRzORHjRolgH14GZdddpn5+8SJE+X00083QL/nnnukc+fO |
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 MyDataObject extends DataObject { | |
private static $db = [ | |
'FoobarCountryCode' => 'Varchar', | |
'FoobarAreaCode' => 'Varchar', | |
'FoobarPhoneNumber' => 'Varchar', | |
'FoobarExtension' => 'Varchar', | |
]; |
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 MaxWidthHeightImageExtension extends DataExtension { | |
/** | |
* Crop an image if it exceeds a certain height. | |
* Use in templates e.g. $Image.SetWidth(200).MaxHeight(200) | |
* | |
* @param integer $maxHeight Max height of image | |
* @return Image |
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/bash | |
echo "running git post receive hook..." | |
DIR=$(git rev-parse --show-toplevel) | |
if [ -e "$DIR/composer.json" ]; then | |
if [ -d "$DIR/vendor" ]; then | |
composer.phar install | |
else | |
composer.phar update | |
fi |
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 Page_Controller extends ContentController | |
{ | |
private static $cdn_domain = 'cdn.mysite.com'; | |
private static $cdn_rewrite = false; | |
public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) | |
{ |