Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
// JS Module Pattern: | |
// http://j.mp/module-pattern | |
// Redefine: $, window, document, undefined. | |
var APP = (function($, window, document, undefined) { | |
// Automatically calls all functions in APP.init | |
$(document).ready(function() { | |
APP.go(); | |
}); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
# replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT | |
# see http://help.papertrailapp.com/ for additional PHP syslog options | |
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
foreach(explode("\n", $message) as $line) { | |
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; | |
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT); | |
} | |
socket_close($sock); |
How to install SASS on Windows 7 | |
1 - Download the ruby http://rubyinstaller.org/downloads/ | |
2 - Click install and select the option to create environment variables | |
( | |
If you forgot to schedule go to: | |
My Computer> Properties> Advanced Options> Environment Variables | |
Look for path and put in the path of the ruby bin installed, eg: C:\Ruby193\bin; | |
) | |
3 - Open cmd and download the gem of the SASS, typing: gem install sass |
<?php | |
function parseAttributes($text) { | |
$attributes = array(); | |
$pattern = '#(?(DEFINE) | |
(?<name>[a-zA-Z][a-zA-Z0-9-:]*) | |
(?<value_double>"[^"]+") | |
(?<value_single>\'[^\']+\') | |
(?<value_none>[^\s>]+) | |
(?<value>((?&value_double)|(?&value_single)|(?&value_none))) |
<?php | |
/* | |
Convert Comments in a MySQL database (in this case from the Diem CMS) to a Wordpress WXR file that can be imported by Disqus | |
usage: $ php export-comments-for-disqus-xml.php > comments.xml | |
*/ | |
$connection = mysql_connect('localhost', 'username', 'password') or die(mysql_error()); | |
$db = mysql_SELECT_db('databasename', $connection); | |
db_query("set character_set_client='utf8'"); | |
db_query("set character_set_results='utf8'"); |
package ca.uwo.csd.cs2212.USERNAME; | |
public class BankAccount { | |
private double balance; | |
public BankAccount(double balance) { | |
this.balance = balance; | |
} |
<? | |
/** | |
* checks if a domain name is valid | |
* @param string $domain_name | |
* @return bool | |
*/ | |
public static function domain_name($domain_name) | |
{ | |
//FILTER_VALIDATE_URL checks length but..why not? so we dont move forward with more expensive operations | |
$domain_len = strlen($domain_name); |
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