Skip to content

Instantly share code, notes, and snippets.

View acouch's full-sized avatar

Aaron Couch acouch

  • Philadelphia, PA
View GitHub Profile
@acouch
acouch / gist:9784746
Created March 26, 2014 14:33
Click on a leaflet map icon in behat using a custom assumption
// Leaflet icons don't haave ids (at least the ones I'm using). Here we can click them by the z-index which is
// the only unique id.
/**
* Click on map icon as identified by its z-index.
*
* @Given /^I click map icon number "([^"]*)"$/
*/
public function iClickMapIcon($num) {
$session = $this->getSession();
@acouch
acouch / drushrc.php
Last active August 29, 2015 14:04
drush alias lookup
<?php
function findFiles($base_dir, $asset_dir, $extensions = array()) {
function glob_recursive($base_dir, &$directories = array()) {
foreach(glob($base_dir, GLOB_ONLYDIR | GLOB_NOSORT) as $folder) {
$directories[] = $folder;
glob_recursive("{$folder}/*", $directories);
}
}
glob_recursive($base_dir, $directories);
$files = array();
@acouch
acouch / gist:93dee6b51b2da4178aaf
Created December 17, 2014 23:23
ckan puppet vagrant extra
curl -L https://npmjs.org/install.sh | sh
sudo apt-get install curl
curl -L https://npmjs.org/install.sh | sh
sudo curl -L https://npmjs.org/install.sh | sh
ls
cd npm/
ls
scripts/install.sh
sudo scripts/install.sh
npm install less nodewatch
@acouch
acouch / index.html
Last active August 29, 2015 14:21
Madison Tree Data and Map
<!doctype html>
<meta charset="UTF8">
<html>
<head>
<title>Madison Tree Types</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.js" charset="utf-8"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
@acouch
acouch / acouch_nvd3-recline.js
Last active August 29, 2015 14:21
recline scope
This file has been truncated, but you can view the full file.
//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// //
// If you are using Chrome, open the Developer Tools and click the gear //
// icon in its lower right corner. In the General Settings panel, turn //
// on 'Enable source maps'. //
// //
// If you are using Firefox 23, go to `about:config` and set the //
@acouch
acouch / ubuntu puppet server passenger install.txt
Created September 12, 2012 20:01 — forked from andys/ubuntu puppet server passenger install.txt
Steps for installing puppet master in Ubuntu 10.04 with ruby 1.8 and passenger
# Puppet Install steps for Ubuntu 10.04, ruby 1.8, and passenger
apt-get -y install build-essential
apt-get -y install bsubversion apache2 libcurl4-openssl-dev libssl-dev mysql-server
apt-get -y install zlib1g-dev apache2-prefork-dev libapr1-dev libaprutil1-dev
apt-get -y install ruby ruby-dev libxmlrpc-ruby libopenssl-ruby libshadow-ruby1.8 irb rdoc libopenssl-ruby1.8 libruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
tar -xvzf rubygems*z
cd rubygems-1.3.7
@acouch
acouch / pressflow.diff
Last active December 23, 2015 17:48
Drupal 7.23 vs Pressflow 7
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index d27f8d1..44f3c72 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -717,6 +717,22 @@ function drupal_settings_initialize() {
}
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
+ // Load environmental config, if present.
+ if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
api = 2
core = 7.x
includes[core] = drupal-org-core.make
; Profile
projects[dkan][type] = profile
projects[dkan][download][type] = git
projects[dkan][download][url] = https://github.com/NuCivic/dkan.git
projects[dkan][download][branch] = 7.x-1.11-RC2
@acouch
acouch / index.html
Created December 11, 2014 20:12
NVD3 Stacked Area Chart using CartoDBs SQL API
<!doctype html>
<meta charset="UTF8">
<html>
<head>
<title>Tornadoes total versus max damage</title>
<meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.js" charset="utf-8"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.js"></script>
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 15 columns, instead of 6. in line 3.
id,year,start_date,end_date,division,results_type,election_type,party,special,offices,reporting_levels,vote_types,notes,source_url,updated_at
md-2012-04-03-primary-democratic,2012,4/3/2012,4/3/2012,ocd-division/country:us/state:md,Certified,Primary,Democratic,FALSE,President,Senate,House,"Early Voting,Early Voting, Absentee and Provisional vote counts are not reported at the precinct level; those counts are only included in the county level files.",http://www.elections.state.md.us/elections/2012/election_data/index.html,2013-05-24 00:00:00-05:00
md-2012-04-03-primary-republican,2012,4/3/2012,4/3/2012,ocd-division/country:us/state:md,Certified,Primary,Republican,FALSE,President,Senate,House,Absentee and Provisional vote counts are not reported at the precinct level; those counts are only included in the county level files.,http://www.elections.state.md.us/elections/2012/election_data/index.html,2013-05-24 00:00:00-05:00
md-2012-04-03-primary-republican,2012,4/3/2012,4/3/2012,ocd-division/country:us/state:md,Ce