Skip to content

Instantly share code, notes, and snippets.

@samrose
samrose / zend_apache_conf_example
Created February 5, 2014 15:18
Zend Apache Conf Example
<VirtualHost *:80>
SetEnv APPLICATION_ENV "development"
ServerName localhost
DocumentRoot /var/www/oss/public
<Directory “/var/www/oss/public">
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
@samrose
samrose / gist:9771210
Created March 25, 2014 21:00
bootstrap 3 popover hover trigger html content
<a type="button" href="http://google.com" class="btn btn-default" data-container="body" data-trigger="hover" data-html="true" data-content="<h2>TEST</h2><img src='https://drupal.org/files/styles/grid-3/public/project-images/bootstrap_project_1.png' />" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover Bottom
</a>
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rm
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
srose@vagrant:/var/www/vagrant.local$ drush --verbose=2 updatedb
Initialized Drupal 7.27 root directory at /var/www/vagrant.local [notice]
Initialized Drupal site default at sites/default [notice]
Undefined index: SERVER_NAME subdomain_field.module:232 [notice]
Undefined index: SERVER_NAME subdomain_field.module:232 [notice]
Undefined index: SERVER_NAME subd
function hook_price_calc($wizard_data_array) {
$pricing_array = array();
$group_query = new EntityFieldQuery();
$group_query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'group')
->propertyCondition('status', 1)
->fieldCondition('field_code','value',$wizard_data_array['subdomain'])//TODO ref this field correctly
$group_result = $group_query->execute();
@samrose
samrose / createdb_cartaro
Created June 29, 2014 19:11
Create database cataro
follow http://perlgeek.de/en/article/set-up-a-clean-utf8-environment
createdb -E UTF8 -T template0 --locale=en_US.UTF-8 --owner=cartaro cartaro
@samrose
samrose / gist:fa047c9f55d9006cebf1
Last active August 29, 2015 14:03
forcefactory puppet
mkdir forcefactory
cd forcefactory
vagrant init
add to Vagrantfile
config.vm.box = "ubuntu/trusty64"
config.vm.box_url = "ubuntu/trusty64"
vagrant up
@samrose
samrose / nodenpmubuntu
Created July 7, 2014 13:37
Getting node and npm to work on ubuntu 12.04
Following https://www.digitalocean.com/community/tutorials/how-to-install-an-upstream-version-of-node-js-on-ubuntu-12-04 to compile and install latest version of node and npm
packages;
apache
postfix
mysql
rt4-clients
@samrose
samrose / py_data_distro
Last active August 29, 2015 14:04
python data distro
#sudo apt-get update
#sudo apt-get install python-pip python-dev libxml2-dev libxslt-dev libatlas-base-dev gfortran
#curl -O http://download.zeromq.org/zeromq-4.0.4.tar.gz
#tar -xzf zeromq-4.0.4.tar.gz
#cd zeromq-4.0.4
#./configure --prefix=$VIRTUAL_ENV && make -j && sudo make install
#pip install pyzmq tornado
curl -O http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.0.1-Linux-x86_64.sh