Skip to content

Instantly share code, notes, and snippets.

[2014-10-03 11:20:31] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\DBALException: "An exception occurred while executing 'SELECT t0.id AS id1, t0.code AS code2, t0.created AS created3, t0.root AS root4, t0.lvl AS lvl5, t0.lft AS lft6, t0.rgt AS rgt7, t0.parent_id AS parent_id8, t0.discr FROM pim_catalog_category t0 WHERE t0.code = ? AND t0.discr IN ('category') LIMIT 1' with params ["ski_men_jackets"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.discr' in 'field list'" at /home/vcap/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 91 {"exception":"[object] (Doctrine\\DBAL\\DBALException: An exception occurred while executing 'SELECT t0.id AS id1, t0.code AS code2, t0.created AS created3, t0.root AS root4, t0.lvl AS lvl5, t0.lft AS lft6, t0.rgt AS rgt7, t0.parent_id AS parent_id8, t0.discr FROM pim_catalog_category t0 WHERE t0.code = ? AND t0.discr IN ('category') LIMIT 1' with params [\"ski_men_jackets\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.
# Arguments:
#
# $1 is the file
# $2 is the type - for those times when file magic isn't enough.
# I frequently get html mail that has no extension
# and file can't figure out what it is.
#
# Set to '-' if you don't want the type to be discerned.
# Many applications can sniff out the type on their own.
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
if x and (y or z)
if x and foo?
def foo?
y or z
@emileswarts
emileswarts / gist:7984291
Created December 16, 2013 09:15
Vimium customizations
unmap x
map d removeTab
unmap X
map u restoreTab
unmap T
map T duplicateTab
unmap K
unmap gt
map en nextTab
unmap J
@emileswarts
emileswarts / gist:6592488
Created September 17, 2013 10:16
ruby float string sort
irb(main):001:0> ar = ["6", "7", "9", "11.5", "6", "8.5"]
=> ["6", "7", "9", "11.5", "6", "8.5"]
irb(main):002:0> ar.sort!
=> ["11.5", "6", "6", "7", "8.5", "9"]
cd RAILS_ROOT
bundle exec rake assets:precompile RAILS_ENV=staging
cd public/assets
mv manifest.yml ../
rm -fr *
mv ../manifest.yml ./
mv app/assets ~/backup_assets_for_pj
mv public/system ~/system_back
vmc update appname (vmc does not know about git or jenkins)
vmc start
@emileswarts
emileswarts / gist:6069115
Created July 24, 2013 09:14
Cloud Foundry VMC blue green
vmc instances project-blue 3
vmc map project-blue www.project.com
vmc map project-blue project.com
vmc unmap project-green www.project.com
vmc unmap project-green project.com
vmc stop project-background-green
vmc start project-background-blue
@emileswarts
emileswarts / gist:5842802
Created June 22, 2013 22:06
./configure vim
--enable-luainterp=yes --enable-multibyte --disable-netbeans --disable-selinux --enable-pythoninterp=yes --enable-python3interp=yes --enable-tclinterp --enable-rubyinterp=yes --enable-cscope --disable-netbeans --enable-multibyte --with-modified-by=Emile --with-features=HUGE --with-compiledby=Emile --with-ruby-command=RUBY
lsof -wni tcp:3000