Skip to content

Instantly share code, notes, and snippets.

View kassner's full-sized avatar

Rafael Kassner kassner

View GitHub Profile
@Ocramius
Ocramius / User.php
Last active July 13, 2025 20:06
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active July 22, 2025 02:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@me-vlad
me-vlad / s3curl.pl.patch
Created February 14, 2012 21:06
s3curl.pl (http://aws.amazon.com/code/128): fix x-amz-date and aws endpoints patch
--- s3curl.pl.orig 2011-08-16 22:23:39.000000000 +0300
+++ s3curl.pl 2012-02-14 22:37:01.594635639 +0200
@@ -26,11 +26,14 @@
use constant STAT_UID => 4;
# begin customizing here
+# http://docs.amazonwebservices.com/general/latest/gr/rande.html#s3_region
my @endpoints = ( 's3.amazonaws.com',
+ 's3-us-west-2.amazonaws.com',
's3-us-west-1.amazonaws.com',
@petemcw
petemcw / gist:1427528
Created December 3, 2011 16:41
Re-order Magento Categories Alphabetically
SET @position = 0;
SET @last_parent = 0;
SET @last_level = 0;
DROP TABLE IF EXISTS `cce_new_position`;
CREATE TEMPORARY TABLE `cce_new_position`
SELECT
`new`.`entity_id` AS `entity_id`,
`new`.`parent_id` AS `parent_id`,
@last_parent := CAST(`new`.`parent_id` AS UNSIGNED) AS `new_parent_id`,
`new`.`name` AS `name`,