Skip to content

Instantly share code, notes, and snippets.

View harmstyler's full-sized avatar

Tyler Harms harmstyler

View GitHub Profile
<?php
/**
* TimeStampedEntity.php
*/
namespace HarmsTyler\Common\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
@harmstyler
harmstyler / sublime-user-settings.json
Last active August 29, 2015 13:56
My ST3 settings
{
// Custom color scheme available at http://buymeasoda.github.com/soda-theme/extras/colour-schemes.zip
"color_scheme": "Packages/User/Monokai Soda (SL).tmTheme",
// Ignored packages, remove Vintage to enable VIM mode
"ignored_packages":
[
"Vintage"
],
// Soda Theme, requires "Theme - Soda" package
"theme": "Soda Dark 3.sublime-theme",
@harmstyler
harmstyler / Post.php
Created April 10, 2014 01:29
Blog Post Doctrine Entity
<?php
namespace Blend\Iterate\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Post
*
* @ORM\Table()
ezpublish:
system:
front_siteaccess:
locaction_view: # This Works
embed:
folder:
controller: "AcmeWebBundle:Content:listAllFolderChildren"
template: AcmeWebBundle:embed:folder.html.twig
match:
Identifier\ContentType: [folder]
@harmstyler
harmstyler / brew --config
Created May 25, 2012 02:04
brew install subversion fails
HOMEBREW_VERSION: 0.9
HEAD: 6a0630ba933dade543cf9ab9ce561c4a2dd7c787
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
state[AL]=ALABAMA
state[AK]=ALASKA
state[AZ]=ARIZONA
state[AR]=ARKANSAS
state[CA]=CALIFORNIA
state[CO]=COLORADO
state[CT]=CONNECTICUT
state[DE]=DELAWARE
state[DC]=DISTRICT OF COLUMBIA
state[FL]=FLORIDA
@harmstyler
harmstyler / handleXmlField.php
Created October 18, 2012 14:42
Handle xml fields in eZ Publish
function handleXmlField($bodyXml, $parser="simple")
{
$parser = new eZSimplifiedXMLInputParser(null);
if ($parser == 'oe') {
$parser = new eZOEInputParser(null);
}
$parser->setParseLineBreaks(false);
$document = $parser->process($bodyXml);
@harmstyler
harmstyler / imageParse.php
Created October 22, 2012 15:08
Function for parsing eZ Images
if (isset($_FILES['photos']) && !empty($_FILES['photos']['tmp_name'])) {
foreach ($_FILES['photos']['tmp_name'] as $i=>$tmp) {
if (!$_FILES['photos']['tmp_name'][$i]) {
continue;
}
$fileName = $_FILES['photos']['name'][$i];
$guid = uniqid();
$path = '/tmp/jshwriteupload/' . $guid . '/';
@harmstyler
harmstyler / addeztag.php
Created October 23, 2012 16:40
Storing eZ Tags
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: tyler
 * Date: 1/6/12
 * Time: 4:33 PM
 * To change this template use File | Settings | File Templates.
 */
class AddeZTag
{
@harmstyler
harmstyler / addTag.php
Created October 23, 2012 15:57
How eZ Tags adds tags
function add($parentTag, $newKeyword)
{
$db = eZDB::instance();
$db->begin();
$tag = new eZTagsObject( array( 'parent_id' => ( $parentTag instanceof eZTagsObject ) ? $parentTag->attribute( 'id' ) : 0,
'main_tag_id' => 0,
'keyword' => $newKeyword,
'depth' => ( $parentTag instanceof eZTagsObject ) ? (int) $parentTag->attribute( 'depth' ) + 1 : 1,
'path_string' => ( $parentTag instanceof eZTagsObject ) ? $parentTag->attribute( 'path_string' ) : '/' ) );