Skip to content

Instantly share code, notes, and snippets.

@greg606
Last active August 17, 2017 14:25
Show Gist options
  • Save greg606/3104646 to your computer and use it in GitHub Desktop.
Save greg606/3104646 to your computer and use it in GitHub Desktop.
cheat sheet
##### symfony
sudo composer create-project symfony/framework-standard-edition path/to/install
php app/console cache:clear --env=prod --no-debug
php app/console assets:install --symlink web/
php app/console generate:bundle --namespace=Creaticon/HelloBundle
php app/console doctrine:database:create
php app/console doctrine:schema:update --force
php app/console doctrine:generate:entity --entity="AcmeStoreBundle:Product" --fields="name:string(255) price:float description:text"
php app/console generate:doctrine:crud
php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Product
#reset db
sf d:d:d --force && sf d:d:c && sf d:s:u --force
php app/console assetic:dump --watch
php app/console assetic:dump --env=prod --no-debug
php app/console container:debug
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
php app/console fos:user:create testuser test@example.com p@ssword --super-admin
##################
source /etc/profile
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
#mac
pbcopy < ~/.ssh/id_rsa.pub
sudo /usr/share/ati/fglrx-uninstall.sh --force
grep -r -i texttosearch *
############## codeigniter
$this->db->last_query();
ctags -R *
remove backup files -
find ./ -name '*~' | xargs rm
mysql -u USERNAME -p -h localhost YOUR-DATA-BASE-NAME-HERE < YOUR-.SQL.FILE-NAME-HERE
###################### vim
s/red/green/g
#comments
[count]<leader>cc
[count]<leader>cm
replace from cursor:
:.,$s/\vBEFORE/AFTER/gc
################### rails
gem install rspec
sudo apt-get install libmysql-ruby libmysqlclient-dev
rails new myapp --skip-test-unit -d mysql
problem with yeoman access rights:
sudo chown -R $USER /usr/local
rails g scaffold feed url:string
rake environment RAILS_ENV=test db:migrate
db:drop
db:create
RAILS_ENV=production rake db:create
feedzirra:
sudo apt-get install libxml2-dev libxslt-dev
kill -9 `cat tmp/pids/server.pid`; rails server -d
###################### git deploy
git init --bare
###################### postgres
sudo -u postgres psql postgres
\password postgres
sudo apt-get install postgresql-contrib
sudo -u postgres psql
CREATE EXTENSION adminpack;
###################### mysql
SET foreign_key_checks = 0;
DELETE FROM users where id > 45;
SET foreign_key_checks = 1;
###################### yo
sudo chown -R greg606 /home/greg606/.npm/
npm install grunt-contrib-compass --save-dev
gem install compass
################# mac
clear dns cache:
dscacheutil -flushcache
sudo killall -HUP mDNSResponder
mysql.server start
mysql.server stop
mysql.server restart
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_connect_back=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment