Skip to content

Instantly share code, notes, and snippets.

View jamesstacyjones's full-sized avatar

Stacy Jones jamesstacyjones

View GitHub Profile
@jamesstacyjones
jamesstacyjones / gist:6644981
Last active December 23, 2015 13:49
symfony - enable debug in twig by placing this into app/config/config_dev.yml
twig:
    debug: %kernel.debug%
services:
   twig.extension.text:
       class: Twig_Extensions_Extension_Text
       tags:
           - { name: twig.extension }
   twig.extension.debug:
 class: Twig_Extensions_Extension_Debug
@jamesstacyjones
jamesstacyjones / gist:6645309
Last active December 23, 2015 13:59
symfony2 - create database entities based on database schema.

From terminal to run these commands. As there are 3 commands to run in order to get Symfony2 to recognize the database as entities.

Step 1: Import database into Bundle and create yaml files. [ --em=dev ] Used to recognize the database to import. In order to do this the database configuration files need to be set up with parameters.yml and config.yml

./app/console doctrine:mapping:import --em=dbname BundleName yml
@jamesstacyjones
jamesstacyjones / gist:6663260
Last active December 23, 2015 16:39
doctrine debug dump
echo '<pre>';
\Doctrine\Common\Util\Debug::dump($nameofvariable);
echo '</pre>';
exit;
@jamesstacyjones
jamesstacyjones / gist:6953856
Last active December 25, 2015 09:29
git ~ ignore files that already exist in the repository

To ignore command:

git update-index --assume-unchanged [path/filename.ext]

To un-ignore command:

git update-index --no-assume-unchanged [path/filename.ext]
@jamesstacyjones
jamesstacyjones / gist:6957439
Last active December 25, 2015 09:49
toggle button with jquery and css.
<a class="togglebutton" title="Toggle Me">Toggle Me</a>
a.togglebutton {
    background: #ccc;
    cursor: pointer;
    border-top: solid 2px #eaeaea;
 border-left: solid 2px #eaeaea;
@jamesstacyjones
jamesstacyjones / gist:7196145
Last active December 26, 2015 18:39
find foreign key constraint errors.
SELECT constraint_name, table_name FROM information_schema.table_constraints WHERE constraint_type = 'FOREIGN KEY' AND table_schema = DATABASE() ORDER BY constraint_name;
@jamesstacyjones
jamesstacyjones / gist:0988723ac1e13231cffc
Created April 30, 2014 21:01
clearfix : let my float go
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
@jamesstacyjones
jamesstacyjones / gist:5d5b9c44028249a290e8
Last active August 29, 2015 14:00
propel :: get last query executed.
echo Propel::getConnection()->getLastExecutedQuery();
@jamesstacyjones
jamesstacyjones / gist:7d6bd4e6067c31b5afea
Last active August 29, 2015 14:02
wordpress :: deactivate all plugins by db
UPDATE wp_options SET option_value = ' a:0:{}' WHERE option_name = 'active_plugins';
@jamesstacyjones
jamesstacyjones / gist:9ce429d82511ff7fc1bf
Last active August 29, 2015 14:19
Change all files and folder recursively.
sudo find foldername -type d -exec chmod 775 {} ";"
sudo find foldername -type f -exec chmod 664 {} ";"