Skip to content

Instantly share code, notes, and snippets.

View seiffert's full-sized avatar
🌥️

Paul Seiffert seiffert

🌥️
View GitHub Profile
@seiffert
seiffert / ZF DB configuration
Created December 11, 2011 18:27
Mayflower Blog - ZF vs. Symfony2
database.adapter = <driver> (e.g. pdo_mysql)
database.params.host = <host> (e.g. localhost)
database.params.username = <user>
database.params.password = <password>
database.params.dbname = <database name>
@seiffert
seiffert / gist:1461955
Created December 11, 2011 18:29
Mayflower Blog - ZF vs. Symfony2 - S2 AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
@seiffert
seiffert / gist:1461961
Created December 11, 2011 18:29
Mayflower Blog - ZF vs. Symfony2 - routing_dev.yml
_assetic:
resource: .
type: assetic
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
@seiffert
seiffert / gist:1461969
Created December 11, 2011 18:30
Mayflower Blog - ZF vs. Symfony2 - config.yml
# app/config.yml
#
# remove the line that imports parameters.ini
imports:
- { resource: security.yml }
framework:
#esi: ~
#translator: { fallback: %locale% }
@seiffert
seiffert / gist:1461971
Created December 11, 2011 18:30
Mayflower Blog - ZF vs. Symfony2 - config_dev.yml
# app/config_dev.yml
#
# add the import statement for parameters_dev.ini
imports:
- { resource: config.yml }
- { resource: parameters_dev.ini }
framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
@seiffert
seiffert / gist:1461974
Created December 11, 2011 18:31
Mayflower Blog - ZF vs. Symfony2 - config_prod.yml
# app/config_prod.yml
#
# add the import statement for parameters.ini
imports:
- { resource: config.yml }
- { resource: parameters.ini }
...
@seiffert
seiffert / gist:1461978
Created December 11, 2011 18:31
Mayflower Blog - ZF vs. Symfony2 - Sample Service Definition
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="welcome.mailer.acme.user" class="Acme\UserBundle\WelcomeMailer" public="false">
<tag name="welcome.mailer" />
<argument type="service" id="acme.mailer" />
FibonacciSequence := Object clone
FibonacciSequence cache := List clone
FibonacciSequence simple := method (num,
if (num <= 2,
1,
self calc(num)
)
)
<!-- template.html -->
<html>
<head>
<title>Hello React</title>
<script src="build/react.min.js"></script>
<script src="build/JSXTransformer.js"></script>
<script src="build/showdown.js"></script>
<script src="build/jquery-1.8.1.min.js"></script>
</head>
<body>
"
/**
* @jsx React.DOM
*/
var converter = new Showdown.converter(),
CommentBox = React.createClass({displayName: 'CommentBox',
loadCommentsFromServer: function() {
$.ajax({
url: '/comments.json',