Skip to content

Instantly share code, notes, and snippets.

View msonnabaum's full-sized avatar

Mark Sonnabaum msonnabaum

  • Lithic
  • San Diego, CA
View GitHub Profile
__drush_ps1() {
local s
s="$(drush site-get)"
[[ -n "$s" ]] && printf "${1:- (%s)}" "$s"
}
drushprompt='$(__drush_ps1 "[%s]")'
gitprompt='$(__git_ps1 "(%s)")'
case "$OS" in
# Install core software.
case node.platform
when "ubuntu"
package_provider = Chef::Provider::Package::Apt
package "curl"
include_recipe "apt"
cookbook_file "/etc/apt/sources.list.d/google-chrome.list"
execute "add-chrome-key" do
gitalias() {
local alias="${1%%=*}" command="${1#*=}"
local prog="${command##git }"
prog="${prog%% *}"
alias $alias="$command"
gitcomplete "$alias" "$prog"
}
gitcomplete() {
local alias="$1" command="$2"
<?php
function drush_phpass_pre_pm_disable($disable) {
if ($disable == 'phpass') {
drush_set_error(dt("YOU SHALL NOT DISABLE PHPASS!!!"));
}
}
#!/bin/bash
TAG="${1}"
BRANCH="branch-${TAG}"
if [[ -n $TAG ]]
then
echo "git co 7.x-4.x"
git co 7.x-4.x
echo "git co -b $BRANCH"
git co -b $BRANCH
<?php
$result = db_query("SHOW TABLES");
while ($t = db_result($result)) {
db_query("ALTER TABLE %s ENGINE = InnoDB", $t);
}
include_recipe "beanstalkd"
include_recipe "waiting_queue"
queues = %w{welcom_events_agenda welcom_events_agenda_user welcom_events_bookmark welcom_events_watchlist}
queues.each do |q|
drush_worker q do
cookbook "waiting_queue"
drupal_docroot "/var/www/welcom"
nice 10
<?php
$options['application'] = 'blah';
$options['deploy-repository'] = 'http://git.drupal.org/project/drush_make.git';
deploy_before('symlink', 'blahtask');
deploy_task('blahtask', function($config) {
drush_print_r($config);
});
diff --git a/commands/pm/package_handler/git_drupalorg.inc b/commands/pm/package_handler/git_drupalorg.inc
index fe933e8..39d3075 100644
--- a/commands/pm/package_handler/git_drupalorg.inc
+++ b/commands/pm/package_handler/git_drupalorg.inc
@@ -215,10 +215,10 @@ function drush_gitcache_add_project($gitcache, $request, $repository) {
if (drush_get_context('DRUSH_VERBOSE')) {
$command .= ' --verbose --progress ';
}
- $command .= '%s';
- if (drush_shell_cd_and_exec($tmpdir, $command, $repository)) {
<?php
$foo = array(
'föö' => 'bår',
);
file_put_contents('blah.txt', json_encode($foo));
$bar = json_decode(file_get_contents('blah.txt'));
var_dump($bar);