Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| /** | |
| * Implements hook_menu_local_task() | |
| * | |
| * @param array $variables | |
| * | |
| * return string with html | |
| */ | |
| function mytheme_menu_local_task($variables) { | |
| $link = $variables['element']['#link']; | |
| // remove the view link when viewing the node | 
| set :shared_files, [app_path + "/config/parameters.yml"] | |
| namespace :symfony do | |
| namespace :configure do | |
| def shared_parameters_path | |
| "#{shared_path}/#{app_path}/config/parameters.yml" | |
| end | |
| def app_parameters_path | |
| "#{latest_release}/#{app_path}/config/parameters.yml" | 
| // Test for the presence of jquery. | |
| if (typeof jQuery == 'function') { | |
| // Fetch a correct token from the user edit form because we will need it to | |
| // successfully submit the user edit form later. | |
| // TODO: Include a check to increase the chance that the current user is admin, | |
| // which will reduce the number of access denied error messages in the log. | |
| jQuery.get(Drupal.settings.basePath + 'user/2/edit', | |
| function (data, status) { | |
| if (status == 'success') { | |
| // Extract the token and other required data | 
| <?php | |
| /** | |
| * @file | |
| * Demo module, Basic Ajax form submit (Ajax framework). | |
| */ | |
| /** | |
| * Implements hook_menu(). | |
| */ | 
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| # Bulk convert shapefiles to geojson using ogr2ogr | |
| # For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/ | |
| # Note: Assumes you're in a folder with one or more zip files containing shape files | |
| # and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere) | |
| #geojson conversion | |
| function shp2geojson() { | |
| ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp" | |
| } | 
| var gulp = require('gulp'), | |
| sass = require('gulp-sass'), | |
| browserify = require('gulp-browserify'), | |
| concat = require('gulp-concat'), | |
| embedlr = require('gulp-embedlr'), | |
| refresh = require('gulp-livereload'), | |
| lrserver = require('tiny-lr')(), | |
| express = require('express'), | |
| livereload = require('connect-livereload') | |
| livereloadport = 35729, | 
TLDR: The cascade={"remove"} is like a "software" onDelete="CASCADE", and will remove objects from the database only when an explicit call to $em->remove() occurs. Thus, it could result in more than one object being deleted. orphanRemoval can remove objects from the database even if there was no explicit call to ->remove().
I answered this question a few times to different people so I will try to sum things up in this Gist.
Let's take two entities A and B as an example. I will use a OneToOne relationship in this example but it works exactly the same with OneToMany relationships.
class A