Skip to content

Instantly share code, notes, and snippets.

@n3b
n3b / ramdisk.sh
Last active August 29, 2015 14:07 — forked from rxin/ramdisk.sh
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@n3b
n3b / install_mcrypt.sh
Created November 12, 2012 16:21 — forked from istepanov/install_mcrypt.sh
Compile and install mcrypt.so PHP extension for Mac OS X 10.8 Mountain Lion
#!/usr/bin/sh
# Scipt for installing mcrypt.so extension for PHP 5.3.13 (default PHP for OS X 10.8 Mountain Lion)
mkdir /tmp/mcrypt
cd /tmp/mcrypt
curl --location --progress-bar http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download | tar -zx
curl --location --progress-bar http://us.php.net/get/php-5.3.13.tar.gz/from/nl.php.net/mirror | tar -zx
@n3b
n3b / MyBundle\Service\Catalog.php
Created July 24, 2011 00:56
Symfony2. Getting service in template.
<?php
namespace MyBundle\Service;
class Catalog
{
protected $em;
public function __construct($em)
{
@n3b
n3b / CheckoutFullType.php
Created July 6, 2011 21:22
symfony2 dynamic validator constraints
<?php
namespace n3b\Bundle\Shop\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormEvents;
class CheckoutFullType extends AbstractType
{
@n3b
n3b / CheckoutDeliveryValidator.php
Created July 6, 2011 16:51
symfony2 custom validator
<?php
namespace n3b\Bundle\Shop\Form\Validator;
use Symfony\Component\Form\Extension\Core\Validator\DefaultValidator;
use Symfony\Component\Form\FormInterface;
class CheckoutDeliveryValidator extends DefaultValidator
{