Skip to content

Instantly share code, notes, and snippets.

@paulschwarz
paulschwarz / gist:2776456
Created May 23, 2012 17:15 — forked from ciastek/gist:2776416
Global Vagrantfile to override number of CPUs used by VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.customize ["modifyvm", :id, "--cpus", 1]
end
@paulschwarz
paulschwarz / bootstrap_chef.bash
Created June 22, 2012 19:55 — forked from chrismdp/bootstrap_chef.bash
Bootstrap Chef Solo on Ubuntu
#!/usr/bin/env bash
# call like this on the target server:
# CHEFREPO='git://github.com/paulsschwarz/vagrant-cookbooks.git' CHEF_ENV='production' bash <( curl -L https://raw.github.com/gist/2974764 )
set -e
export RUBYGEMS_VERSION="1.8.24"
export CHEF_DIR="${HOME}/chef"
sudo rm -rf $CHEF_DIR
mkdir -p "$CHEF_DIR"
@paulschwarz
paulschwarz / foo.rb
Created September 28, 2012 20:24 — forked from fujin/foo.rb
template override between cookbooks
template "/tmp/foo.rb"
source "foo.rb.erb"
cookbook "banana"
end
@paulschwarz
paulschwarz / foo.rb
Created September 28, 2012 20:27 — forked from fujin/foo.rb
template override between cookbooks
template "/tmp/foo.rb"
source "foo.rb.erb"
cookbook "banana"
end
<?php
class FooValidator implements Validator
{
public function __construct(Validator $validator)
{
$this->validator = $validator
$this->validator->rule('name', 'not_empty')
->rule('name', 'max_length', [':value', 35])
->rule('name', 'min_length', [':value', 5]);
<html>
<head>
</head>
<body>
I'm the chrome.
<div id="a big div that wraps admin, where's the problem?">
I'm the admin menu