Skip to content

Instantly share code, notes, and snippets.

@welly
welly / px-to-em.scss
Created August 5, 2013 13:55
PX to EM conversion functions
// Functions for px to em conversions
// ------------------------------------------------------------
@function emify($target, $context) {
@if $target == 0 { @return 0 }
@return $target / $context + 0em;
}
// Make px to ems using base-font-size
// echo as: font-size: em-font(#px);
$data = array(
'bundles' => array(
'innovation' => (object) array(
'type' => 'innovation',
'name' => 'Innovation',
'base' => 'node_content',
'module' => 'node',
'description' => '',
'help' => '',
'has_title' => '1',
@welly
welly / gist:9488754
Created March 11, 2014 15:56
MySQL: Update field in table from another table via several joins
update field_data_field_user_about f
join profile p on f.entity_id = p.pid
join node n on p.uid = n.uid
join content_type_profile c on c.nid = n.nid
set f.`field_user_about_value` = c.`field_user_about_value`
<?php
/**
* This is example code for a Drupal 6 to Drupal 7 migration. This won't actually
* work without defining the referenced vocabularies, content types, and fields
* on each side.
*/
/**
* Implements hook_flush_caches().
<?php
/**
* @file
* local.settings.php
*
* This settings file is intended to contain settings specific to a local
* development environment, by overriding options set in settings.php.
*
* Include this file from your regular settings.php by including this at the
* bottom:
<?php
/**
* @file
* local.settings.php (Drupal 6.x)
*
* This settings file is intended to contain settings specific to a local
* development environment, by overriding options set in settings.php.
*
* Include this file from your regular settings.php by including this at the
* bottom:
@welly
welly / settings.php
Last active August 29, 2015 14:00
Standard, semi-minimised Drupal settings.php file for Drupal 7
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASS'),
@welly
welly / civicrm.settings.php
Last active August 29, 2015 14:00
Standard minimised Civicrm settings file
<?php
define( 'CIVICRM_UF', 'Drupal' );
define( 'CIVICRM_UF_DSN', 'mysql://' . $_SERVER['DB_USER'] . ':' . $_SERVER['DB_PASS'] . '@' . $_SERVER['DB_HOST'] . '/' . $_SERVER['DB_NAME'] . '?new_link=true');
define( 'CIVICRM_DSN', 'mysql://' . $_SERVER['DB_CIVIUSER'] . ':' . $_SERVER['DB_CIVIPASS'] . '@' . $_SERVER['DB_CIVIHOST'] . '/' . $_SERVER['DB_CIVINAME'] . '?new_link=true' );
define('CIVICRM_LOGGING_DSN', CIVICRM_DSN);
global $civicrm_root;
$site_root = '/Users/alastair/dev/clients/chagos/httdocs';
@welly
welly / .gitignore
Created May 2, 2014 11:22
Drupal gitignore
# Ignore system files etc.
.DS_Store
.htaccess
.idea
whitefusestub.make
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private
@welly
welly / settings.php
Last active August 29, 2015 14:01
Standard, semi-minimised settings file for Drupal 6
<?php
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'uat_iapo_drupal',
'username' => 'uat_dba',
'password' => '3W5LcJQv26DpxGMm',