Skip to content

Instantly share code, notes, and snippets.

@dlip
dlip / gist:5712522
Created June 5, 2013 08:41
symfony fos_rest config
fos_rest:
param_fetcher_listener: true
view:
view_response_listener: true
failed_validation: HTTP_BAD_REQUEST
default_engine: php
formats:
json: true
format_listener:
prefer_extension: true
@dlip
dlip / gist:5712491
Created June 5, 2013 08:36
run composer install with symfony env prod
SYMFONY_ENV=prod ./composer.phar install
@dlip
dlip / gist:5712378
Created June 5, 2013 08:15
xdebug vagrant config
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.33.1
xdebug.remote_port=9000
xdebug.remote_cookie_expire_time=36000
xdebug.profiler_enable_trigger = 1;
xdebug.profiler_output_dir = "/vagrant/profiler"
xdebug.profiler_output_name = cachegrind.out.%t.%p
@dlip
dlip / gist:5712371
Created June 5, 2013 08:14
vagrant increase memory / enable multicore
config.vm.customize ["modifyvm", :id, "--memory", "1024", "--ioapic", "on"]
# Set cpu cores
if not RUBY_PLATFORM.downcase.include?("mswin")
config.vm.customize ["modifyvm", :id, "--cpus",
`awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ]
end
@dlip
dlip / gist:5711811
Created June 5, 2013 05:35
Banshee toggle playing from console
banshee --toggle-playing
@dlip
dlip / gist:5711808
Created June 5, 2013 05:33
Focus chrome from console command
wmctrl -a 'Google Chrome'
@dlip
dlip / svn_log_increment_redmine.rb
Created August 4, 2010 08:00
Increments the trac ticket numbers in the svn log and replaces "ticket:" with # for Redmine multi project
@repo = "file:///path_to_svn_repo"
#How much each ticket should be incremented by
@increment_ticket = 100
#If the incremented ticket is above or below these numbers it will not increment
#Useful if you have a svn repository which refers to tickets in another project
@ticket_min = 0
@ticket_max = 100000
class SvnEntry
attr_accessor :revision, :log