# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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 | |
$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array( | |
'label' => 'Image', | |
'file_src' => sprintf('/uploads/%s/%s', sfConfig::get('app_upload_image_path', 'images') ,$this->getObject()->getImage()), | |
'is_image' => true, | |
'edit_mode' => !$this->isNew(), | |
'template' => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>', | |
)); | |
$this->validatorSchema['image_delete'] = new sfValidatorBoolean(); |
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 | |
protected function _editAction(Post $post) | |
{ | |
$em = $this->get('doctrine.orm.default_entity_manager'); | |
$factory = $this->get('form.factory'); | |
$form = $factory->create(new PostFormType()); | |
$form->setData($post); | |
if ($this->get('request')->getMethod() === 'POST') { |
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
//app.js Socket IO Test | |
var app = require('express').createServer(), | |
redis = require('socket.io/node_modules/redis'), | |
io = require('socket.io').listen(app); | |
var pub = redis.createClient(port, "url"); | |
var sub = redis.createClient(port, "url"); | |
var store = redis.createClient(port, "url"); | |
pub.auth('pass', function(){console.log("adentro! pub")}); | |
sub.auth('pass', function(){console.log("adentro! sub")}); |
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
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_unpushed { | |
local unpushed=`/usr/bin/git cherry -v origin/$(get_git_branch) 2> /dev/null` | |
[[ "$unpushed" != "" ]] && echo "$(tput setaf 1) ++> $(tput sgr0)" | |
} |
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 | |
namespace ExampleBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilder; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Edge5\TestProjectBundle\Form\addTranslatedFieldSubscriber; |
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
services: | |
log.handler.db: | |
class: "Vendor\\Log\\Handler\\Db" | |
arguments: | |
manager: @em | |
logger.db: | |
class: "Monolog\\Logger" | |
arguments: | |
name: "db" | |
calls: |
Some parts taken from: https://gist.github.com/kujohn/7209628
ipfw
is officially deprecated and removed in OS X Yosemite. Pow requires another program pf
to handle the port forwarding.
Create file /etc/pf.anchors/pow