Skip to content

Instantly share code, notes, and snippets.

@bjeavons
bjeavons / acquia_spi.install.patch
Created November 29, 2011 17:37
Fix for undefined function
diff --git a/acquia_spi/acquia_spi.install b/acquia_spi/acquia_spi.install
index 1a311c2..396429c 100644
--- a/acquia_spi/acquia_spi.install
+++ b/acquia_spi/acquia_spi.install
@@ -21,12 +21,13 @@ function acquia_spi_uninstall() {
function acquia_spi_requirements($phase) {
$requirements = array();
- $has_credentials = acquia_agent_has_credentials();
$last_sent = variable_get('acquia_spi_cron_last', 0);
<?php
function localdev_drush_command() {
$items = array();
$items['lcld'] = array(
'description' => 'Delete nodes',
'callback' => 'drush_lcld',
'options' => array(
'type' => 'node type',
@bjeavons
bjeavons / a-dl-dbs
Created May 31, 2012 15:29
Download database from Acquia for any alias
#!/usr/bin/env bash
# Usage: FILE [site-alias] [file]
# Note: do not provide @ symbol for alias
# e.g.: a-dl-dbs acquiacom.prod prod-insight-insight-2012-05-29.sql.gz
HOST=`drush sa --component=remote-host @$1`
USER=`drush sa --component=remote-user @$1`
scp $USER@$HOST:/mnt/files/$1/backups/$2 $2 && chmod 600 $2
#!/usr/bin/env bash
CURL="/usr/bin/curl"
GROWL="/usr/local/bin/growlnotify"
URL=$1
CODE=`$CURL -sL -w "%{http_code}" $1 -o /dev/null`
if [ "$CODE" -ne 200 ]
then $GROWL -t "IS DOWN" -m "$URL"
fi
@bjeavons
bjeavons / localdev.drush.inc
Created June 20, 2012 18:52
bulk delete drupal nodes of a type
<?php
function localdev_drush_command() {
$items = array();
$items['lcld'] = array(
'description' => 'Delete nodes',
'callback' => 'drush_lcld',
'options' => array(
'type' => 'node type',
require 'rubygems'
require 'sinatra/base'
class MyApp < Sinatra::Base
disable :protection
get '/' do
g = params[:arg]
t1 = Thread.new do
sleep 4
File.open("data.txt", "a+") do |f|
@bjeavons
bjeavons / jshijack.html
Last active September 30, 2021 07:00
Testing Javascript hijacking via object overloading.
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title>js hijack testing</title>
</head>
<body>
@bjeavons
bjeavons / keybase.md
Created March 26, 2014 20:33
keybase prove

Keybase proof

I hereby claim:

  • I am bjeavons on github.
  • I am bjeavons (https://keybase.io/bjeavons) on keybase.
  • I have a public key whose fingerprint is 0AEF 8A87 37CB C737 0240 B91A FE7F 71A1 0529 7D50

To claim this, I am signing this object:

@bjeavons
bjeavons / boris-quickstart.md
Created January 9, 2015 21:15
boris quickstart for Drupal magic

You'll need boris and boris-loader and then set a boris bootstrap for your Drupal repos.

Install boris however you prefer. I have a /usr/local/bin/boris symlink to the boris vendor binary under ~/.composer

Install boris-loader. I just cloned the repos to my homedir.

Set up a Drupal bootstrap in your local Drupal dirs.

var http = require('http');
var cheerio = require('cheerio');
function parse_feed (content, hook, callback) {
$ = cheerio.load(content);
$('entry').each(function(i, elem) {
hook.debug($(this).find('title').text());
});
callback();
}