This file contains hidden or 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
Principles: There's more than one way to do it! / do what I mean! | |
GENERAL | |
======= | |
use <string>; | |
- Pragmas, intepreted before script runs | |
- Use 'strict' and 'warnings' to enforce good syntax | |
- Also used to import libraries |
This file contains hidden or 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
-. = Any Single character | |
-+ = One or more of preceding character | |
-? = Zero or one of preceding character | |
-* = One or more of preceding character | |
-^ = Start of string | |
-$ = End of string | |
-| = or | |
-(Escape any of above with \, for literal \ use \\) | |
-{n} = n of preceding character | |
-{n,} = At least n of preceding character |
This file contains hidden or 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
COMMAND MODE | |
i = Enter insert mode | |
o = Insert after current line (enter insert mode) | |
O = Insert before current line (enter insert mode) | |
a = Append after current character (enter insert mode) | |
A = Append at end of line (enter inset mode) | |
u = undo |
This file contains hidden or 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
Note that all of these clients take standard mysql client options, e.g. host / password etc | |
mysqladminm | |
- Issue one off commands | |
- http://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html | |
mysqladmin [options] command [command-arg] [command [command-arg]] ... | |
This file contains hidden or 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
Template naming convention | |
<bundle>:<controller>:<template> | |
<bundle> translates to /src/BundleStart/BundleEnd/ (e.g. AcmeBlogBundle -> src/Acme/BlogBundle) | |
<controller> means template in /Resources/Views/<controller> | |
<template> is actual name of file in format <name>.<format>.<engine> e.g. index.html.php or smeg.xml.twig | |
::base.html.twig means template in application wide dir i.e. app/Resources/Views/ | |
{{ <variable> }} - Output value |
This file contains hidden or 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
CONNECT | |
DELETE | |
GET | |
HEAD | |
OPTIONS | |
PATCH | |
POST | |
PUT | |
TRACE |
This file contains hidden or 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
Basics | |
====== | |
Expansion (special symbols replaced by values) and word splitting (arguments being split into several aruments) must have attemtion paid or pain will follow. | |
- # for comments | |
- Lots of internal variables available to bash scripts, see: http://tldp.org/LDP/abs/html/internalvariables.html#ARGLIST | |
- Name of script will be $0 | |
- Parameters passed to script will be in $1, $2, $3.... vars and count in $# |
This file contains hidden or 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 | |
/** | |
Template Name: Gists | |
*/ | |
get_header(); ?> | |
<div id="container"> | |
<div id="content" role="main"> | |
<h1 class="entry-title">Gists</h1> | |
<hr /><br /> |
This file contains hidden or 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
#Front Controller rewrite | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^.*$ index.php [L,NC] | |
# Ensure we are using HTTPS | |
RewriteCond %{HTTPS} !on | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains hidden or 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
Enable tracing example: | |
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so" | |
xdebug.auto_trace=1 | |
xdebug.trace_output_dir="/tmp/xdebug/" | |
xdebug.collect_params=4 | |
xdebug.collect_return=1 | |
xdebug.trace_options=1 | |
xdebug.show_local_vars=1 |