Skip to content

Instantly share code, notes, and snippets.

View freshface's full-sized avatar

Frederik Heyninck freshface

View GitHub Profile
@freshface
freshface / gist:045d803f0b55680ca97ffa92f78a1f08
Created September 30, 2016 09:24
CreateContentBlockHandler
public function handle(CreateContentBlock $createContentBlock)
{
$createContentBlock->contentBlock = ContentBlock::create(
$this->contentBlockRepository->getNextIdForLanguage($createContentBlock->language),
$createContentBlock->userId,
$this->getNewExtraId(),
$createContentBlock->language,
$createContentBlock->title,
$createContentBlock->text,
To: "Frederik Heyninck" <frederik@domain.ltd>
Reply-To: frederik@domain.ltd
X-Priority: 3
X-Mailer: SpoonEmail (part of Spoon library - http://www.spoon-library.com)
MIME-Version: 1.0
Content-Type: multipart/alternative; charset="utf-8"; boundary="SEB1_af185e8c11ed41496128e182312a0340"
Importance: normal
Priority: normal
This is a multi-part message in MIME format.
160909 06:53:34 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql56
2016-09-09 06:53:34 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-09-09 06:53:34 0 [Note] /Applications/MAMP/Library/bin/mysqld (mysqld 5.6.28) starting as process 3736 ...
2016-09-09 06:53:34 3736 [Warning] Can't create test file /Library/Application Support/appsolute/MAMP PRO/db/mysql56/Frederiks-MacBook-Pro.lower-test
2016-09-09 06:53:34 3736 [Warning] Can't create test file /Library/Application Support/appsolute/MAMP PRO/db/mysql56/Frederiks-MacBook-Pro.lower-test
/Applications/MAMP/Library/bin/mysqld: Can't change dir to '/Library/Application Support/appsolute/MAMP PRO/db/mysql56/' (Errcode: 2 - No such file or directory)
2016-09-09 06:53:34 3736 [ERROR] Aborting
2016-09-09 06:53:34 3736 [Note] Binlog end
2016-09-09 06:53:34 3736 [Note] /Applications/MAMP/
@freshface
freshface / Query
Last active August 29, 2015 14:21
Treepaths
public static function getTreeByParent($ids)
{
$ids = (array) $ids;
$ids = implode($ids, ',');
// @todo see http://stackoverflow.com/questions/8252323/mysql-closure-table-hierarchical-database-how-to-pull-information-out-in-the-c/8288201#8288201 for visual
// the whole tree
// http://karwin.blogspot.be/2010/03/rendering-trees-with-closure-tables.html
// build query
Figure8\UserBundle\Entity\User:
oneToMany:
settings:
targetEntity: Figure8\UserBundle\Entity\Setting
mappedBy: user
type: entity
table: fos_users
repositoryClass: Figure8\UserBundle\Entity\SettingRepository
fields:
id:
$this->header->addJS('/frontend/modules/' . $this->getModule() . '/js/cycle.js', false);
@font-face {
font-family: 'AntipastoExtraBold';
src: url('../fonts/antipasto_extrabold-webfont.eot');
src: url('../fonts/antipasto_extrabold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/antipasto_extrabold-webfont.woff') format('woff'),
url('../fonts/antipasto_extrabold-webfont.ttf') format('truetype'),
url('../fonts/antipasto_extrabold-webfont.svg#AntipastoExtraBold') format('svg');
font-weight: normal;
font-style: normal;
src:url(../../themes/triton/core/layout/css/'../fonts/antipasto_extrabold-webfont.eot?#iefix')
@freshface
freshface / gist:1666509
Created January 23, 2012 23:44
Fork Profile LoginLogout Widget
<?php
class FrontendProfilesWidgetLoginLogout extends FrontendBaseWidget
{
/**
* Execute the extra
*
* @return void
*/
public function execute()
public static function getMimeTypes()
{
$mimes = array( 'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
'bin' => 'application/macbinary',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => array('application/octet-stream', 'application/x-msdownload'),