This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_profile_data_wrapper($uid) { | |
$query = new EntityFieldQuery; | |
$result = $query->entityCondition('entity_type', 'profile2')->entityCondition('bundle', 'main')->propertyCondition('uid', $uid)->execute(); | |
if (!empty($result)) { | |
try { | |
$entity_info = current($result['profile2']); | |
$entity_wrapper = entity_metadata_wrapper('profile2', $entity_info->pid); | |
return $entity_wrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remote management | |
git remote -v | |
git remote add <remote-name> <url> | |
git remote set-url <remote-name> <url> | |
# Working with branches | |
git branch : Show all local branches git knows about | |
git branch -a : Show all branches on all remotes that git knows about | |
git log : Show the commits on the current local branch | |
git reset --hard <ref-name> : Reset the current branch to the given ref (a ref could be a commit hash or a branch name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# template script for generating CentOS container for LXC | |
# | |
# | |
# lxc: linux Container library | |
# Authors: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant::Config.run do |config| | |
config.vm.define :lucid32 do |lucid32_config| | |
lucid32_config.vm.box = "lucid32" | |
lucid32_config.vm.forward_port 22, 22221 | |
lucid32_config.vm.network :hostonly, "172.30.30.1" | |
end | |
config.vm.define :lucid64 do |lucid64_config| | |
lucid64_config.vm.box = "lucid64" | |
lucid64_config.vm.forward_port 22, 22222 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== VirtualBox VM with root device on a ZFS zvol exported through FreeNAS's iSCSI | |
=== (4 disk RAIDZ2 volume populated with 4 x 2TB Seagate Barracuda 7200 RPM drives) | |
=== The Mac mini and the FreeNAS have a gigabit connection to one another | |
smerrill@stash-cache:~$ mysqlslap --auto-generate-sql --concurrency=100 --number-of-queries=10000 --engine=innodb | |
Benchmark | |
Running for engine innodb | |
Average number of seconds to run all queries: 13.877 seconds | |
Minimum number of seconds to run all queries: 13.877 seconds | |
Maximum number of seconds to run all queries: 13.877 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"undef": false, | |
"predef": ["Drupal", "jQuery"], | |
"browser": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn words [x] (re-seq #"[a-z]+" (lower-case x))) | |
(def NWORDS (frequencies (words (slurp "big.txt")))) ; @TODO: Move from slurp. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class drush::files { | |
file { "/usr/share/pear/drush/drushrc.php": | |
ensure => present, | |
source => "puppet:///modules/drush/$environment/drushrc.php", | |
require => Class["drush::packages"], | |
} | |
file { "/usr/share/pear/drush/aliases.drushrc.php": | |
ensure => present, | |
source => "puppet:///modules/drush/$environment/aliases.drushrc.php", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
casper = require('casper').create({ | |
verbose: true, | |
logLevel: "debug" | |
}) | |
# Variables for the tests. | |
url = "http://georgia.gov" | |
breakpoints = [ | |
[1280, 1024], | |
[960, 640], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up some variables relating to which path Vagrant will try to share | |
# with the VM. | |
require 'pathname' | |
$docroot_name = "path/to/your/docroot" | |
$docroot_path = "" | |
# Test that the directory to be shared is in the right place and if it is, | |
# calculate the fully dereferenced path (since NFS exports will fail if you | |
# try to specify the path to a symlink.) | |
if !File.exists?("../#{$docroot_name}") then |