Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import os
all_csv = [file_name for file_name in os.listdir(os.getcwd()) if '.csv' in file_name]
li = []
for filename in all_csv:
df = pd.read_csv(filename, index_col=None, header=0, parse_dates=True, infer_datetime_format=True)
li.append(df)
@seanberto
seanberto / gist:5391851
Last active December 16, 2015 06:29
Quick Views export for displaying Entity Form submissions on a RedHen Contact record. Depends upon http://drupal.org/project/redhen and http://drupal.org/project/entityform
$view = new view();
$view->name = 'contact_eform';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'redhen_contact';
$view->human_name = 'contact eform';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@seanberto
seanberto / chosen.patch
Created April 20, 2012 04:00
Drupal Chosen Module Patch
diff --git a/chosen.js b/chosen.js
index 1e66381..3b4c801 100644
--- a/chosen.js
+++ b/chosen.js
@@ -2,23 +2,27 @@
Drupal.behaviors.chosen = {
attach: function(context) {
var minWidth = Drupal.settings.chosen.minimum_width;
-
+
@seanberto
seanberto / example_profile.install
Created March 7, 2012 03:05
Useful Drupal 7.x install profile CRUD
/**
* ABOUT: The following code snippet shows how to use the CRUD tools in thinkshout_crud.inc to quickly create placeholder nodes
* and menu items in a Drupal 7.x installation profile. This is /not/ a working install profile. You can call the CRUD functions
* anywhere in your install profile. We generally do so in a post_install tasks, to ensure any menu paths defined in modules have
* been loaded into the database.
/**
* Implement hook_install_tasks_alter().
*/
function example_profile_install_tasks_alter(&$tasks, $install_state) {