Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Tyler Harms harmstyler

😀
View GitHub Profile
View TimeStampedEntity.php
<?php
/**
* TimeStampedEntity.php
*/
namespace HarmsTyler\Common\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
View sublime-user-settings.json
{
// 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 Apr 10, 2014
Blog Post Doctrine Entity
View Post.php
<?php
namespace Blend\Iterate\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Post
*
* @ORM\Table()
View ezpublish.yml
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
brew install subversion fails
View brew --config
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
View states.ini
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 Oct 18, 2012
Handle xml fields in eZ Publish
View handleXmlField.php
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 Oct 22, 2012
Function for parsing eZ Images
View imageParse.php
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 . '/';
View addeztag.php
<?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 Oct 23, 2012
How eZ Tags adds tags
View addTag.php
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' ) : '/' ) );