Skip to content

Instantly share code, notes, and snippets.

View iaminawe's full-sized avatar

Gregg Coppen iaminawe

View GitHub Profile
@abelb
abelb / pager.scss
Created August 8, 2012 22:43
drupal pager scss mixin
@mixin pager($radius: 2px, $background_1: #F8F8F8, $background_2: #ECECEC, $border: #c6c6c6, $font-color: #999) {
// Pager list-style
li {
margin-right: 5px;
padding: 0;
&.last {
margin-right: 0;
}
@saltednut
saltednut / dice.sh
Last active March 26, 2016 04:09
quick build script for Drupal distributions that ship with a build makefile
#!/usr/bin/env bash
# Usage: dice makefile docroot dbuser dbpass dbname sitename install-profile
drupal_install_clean_env() {
if [[ -r $2 ]]; then
sudo rm -r $2
cd ~/
fi
if [[ -r $1 ]]; then
drush make --working-copy --concurrency=5 $1 $2
@omega8cc
omega8cc / gist:5724528
Last active March 14, 2024 13:28
Steps to implement (pseudo) Single Sign-On (SSO) for any set of sub-sites on BOA
Steps to implement (pseudo) Single Sign-On (SSO) for any set of sub-sites on BOA:
1. Add domains and even wildcard *.sub.domains as aliases to your site in Aegir
2. Install and configure Domain Access -- https://drupal.org/project/domain
3. Set 'server_name_cookie_domain = TRUE' in the modules/boa_site_control.ini file
Done!
How it works?
<?php
/**
* d6to7_cck_textfield_length_checker.php, a script to find Drupal 6
* CCK text fields that are longer than 255 characters.
*
* Written by Mark Jordan, [email protected] and released into the
* public domain.
*
* Upgrading to Drupal 7 from Drupal 6 instances that use CCK can
@mrmanc
mrmanc / osx-color-pcl
Last active November 3, 2024 09:58
Describes how to set up OS X to print in color to a PCL printer.
You need to have Foomatic-RIP and Ghostscript installed. You can find links to installers on this page: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/macosx/pxlmono (alternatively you can install ghostscript using brew with ‘brew install ghostscript’). There is a pxlmono download on that page which contains loads of PPD files for all sorts of printers, but none of them support colour.
Once the dependencies are installed, you can use pxlcolor to generate a PPD file on this page for the printer, or generate a Generic PCL 6/PCL XL Printer PPD file (attached), which allows you to print with colour.
http://www.openprinting.org/driver/pxlcolor
Set the printer up using Cups. To do this you need to enable the web interface by running this from a Terminal prompt:
cupsctl WebInterface=yes
You can then browse Cups on http://localhost:631/printers/
@awolfey
awolfey / readme.md
Created January 8, 2015 16:42
Make alternative text required in CKeditor image dialog.
CKEDITOR.on('dialogDefinition', function(ev) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
var dialog = ev.data.definition.dialog;
switch (dialogName) {
case 'image': //Image Properties dialog
// Require alt text.
var altField = infoTab.get('txtAlt');
@jameswilson
jameswilson / pager.tpl.php
Last active August 19, 2020 15:42
Drupal 7 Accessible Pager (Backport from Drupal 8)
<?php
// Place this file your theme's "templates" folder.
/**
* @file
* Theme override to display a pager.
*
* This is a backport of pager.html.twig from Drupal 8 to Drupal 7, which add
* accessibility support for WCAG 2.0 section 2.4.9.
*
@cstroe
cstroe / OpenSourceCRM.rst
Last active May 9, 2025 05:34
A distilled list of open-source CRM software
@mecmartini
mecmartini / render-reponsive-image-style-twig-drupal.html-twig
Created December 13, 2019 17:18
How to render responsive image style on Twig in Drupal
{% set imagePath = 'public://images/default.jpg' %}
{% set responsiveimagestyle = {
'#theme': 'responsive_image',
'#responsive_image_style_id': 'my_responsive_image_style_id',
'#uri': imagePath,
'#alt': 'my alt text',
'#attributes': { class: 'img-responsive' },
} %}
{{ responsiveimagestyle }}

Instructions for a mac on how to play with pyenv and poetry

Why both? Pyenv to manage multiple python versions. You can make virtualenvs with pyenv of course, but using poetry will simplify that process

# Install pyenv.
brew install pyenv

# Add pyenv initializer to shell startup script.
echo -e '\nif command -v pyenv 1>/dev/null 2>&1; then