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
#sf_admin_container ul.sf_admin_td_actions li a { | |
padding-left:20px; | |
padding-top: 3px; | |
} |
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 | |
$number = '0123456789394872394'; | |
$match = array(); | |
preg_match_all('/(.{1,3})/', $number, $match); | |
$res = implode(' ', $match[0]); | |
var_dump($res); | |
?> |
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 | |
/** | |
* Override processUploadedFile in ObjectForm | |
* Require sfImageTransformPlugin | |
* @see lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine::processUploadedFile() | |
*/ | |
protected function processUploadedFile($field, $filename = null, $values = null) { | |
$filename = parent::processUploadedFile($field, $filename, $values); | |
if ($filename != "" && $values[$field]) { | |
$method = 'scale'; |
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 | |
/** | |
* @Route("/demo/secured") | |
*/ | |
class SecuredController extends Controller | |
{ | |
/** | |
* @Route("/login", name="_demo_login") | |
* @Template() | |
*/ |
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
#!/bin/sh | |
# Pre-commit hook passing files through jslint | |
# | |
# This ensures that all js, html and json files are valid and conform | |
# to expectations. | |
ROOT_DIR=$(git rev-parse --show-toplevel) | |
JSLINT="${ROOT_DIR}/node_modules/.bin/jslint --indent 4 --white true" |
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
Vagrant::Config.run do |config| | |
config.vm.box = "lucid32" | |
config.vm.box_url = "http://files.vagrantup.com/lucid32.box" | |
config.vm.network :hostonly, "10.0.0.2" | |
config.vm.forward_port 27017, 27017 | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "." | |
puppet.manifest_file = "puppet.pp" | |
end | |
end |
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
# Setup a PPA repo, where the name is "user/ppaname", e.g. "blueyed/ppa" ("ppa" being the default) | |
define pparepo($apt_key = "", $dist = $ppa_default_name, $supported = ["lucid", "hardy"], $ensure = present, $keyserver = "keyserver.ubuntu.com") { | |
$name_for_file = regsubst($name, '/', '-', 'G') | |
$file = "/etc/apt/sources.list.d/pparepo-${name_for_file}.list" | |
file { "$file": } | |
case $ensure { | |
present: { | |
if ($dist) and ($dist in $supported) { | |
File["$file"] { |
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 Acme\DemoBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Security\Core\Role\SwitchUserRole; |
OlderNewer