Skip to content

Instantly share code, notes, and snippets.

/* Utility Bar
--------------------------------------------- */
.utility-bar {
background-color: #333;
border-bottom: 1px solid #ddd;
color: #ddd;
font-size: 12px;
font-size: 1.2rem;
padding: 10px 0;
@nikolov-tmw
nikolov-tmw / multiple-roles-per-user.php
Last active October 5, 2021 03:56
Multiple roles per user WordPress plugin.
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
@portfola
portfola / author.php
Last active May 6, 2023 18:15
Custom User Taxonomies in WordPress
<?php
/**
* The template for displaying Profile pages.
*
* Used for Artist and Cultural Org "mini" pages.
*
* @package ArtsWestchester
* @since ArtsWestchester 1.0
*/
@danaskallman
danaskallman / sample-js-civevent-v02-Register.extra.tpl
Created July 30, 2014 19:53
Sample JS for Event Custom Template v.02
{literal}
<script type="text/javascript">
(function(glo, window, $ ){
// set up a little namespace
if(!glo.ui) glo.ui = {
forms: {}
};
// A field that is dependent on the value of a previous field.
@christianwach
christianwach / civicrm-modifier.php
Last active November 23, 2016 19:11
Basic CiviCRM Modification
<?php /*
--------------------------------------------------------------------------------
Plugin Name: CiviCRM Modifier
Plugin URI: http://haystack.co.uk
Description: Custom code to modify CiviCRM's behaviour in a multisite context
Author: Christian Wach
Version: 0.1
Author URI: http://haystack.co.uk
--------------------------------------------------------------------------------
*/
@iandunn
iandunn / camptix-gravatar-badges.php
Last active August 5, 2022 14:26
CampTix Attendee Badges with Gravatars
<?php
/*
* Generate a CSV for InDesign with attendee info and Gravatars
*
* See http://plan.wordcamp.org/helpful-documents-and-templates/create-wordcamp-badges-with-gravatars/ for instructions
*
* input is a CSV export of CampTix attendees. Format is: "First Name","Last Name","E-mail Address","Twitter Username"
* the script downloads the attendee's Gravatars, and adds a column to the CSV with the filename of the image
* the CSV can then be used by InDesign to generate wordcamp badges with the attendee's gravatar
@salcode
salcode / .gitignore
Last active July 10, 2024 14:28
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.

CiviCRM Hooks in Drupal

civicrm_permission()

This hook can supply permissions that the module defines, so that they can be selected on the user permissions page and used to grant or restrict access to actions the module performs. - * documentation

Retrieves permissions from `CRM_Core_Permission::basicPermissions()`` and returns array to Drupal.

civicrm_block_info()

@colemanw
colemanw / gitpr
Last active October 14, 2016 13:10
GitPR script
#!/bin/bash
# start at top directory if we're not already there
pushd "$(git rev-parse --show-toplevel)" > /dev/null
# run style checker
civilint
if [[ $? == 1 ]]
then
echo "PR aborted"
@xurizaemon
xurizaemon / strip-triggers.sh
Created March 16, 2017 18:57
MySQL - strip trigger owners from a .sql dump
perl -pi -e 's#\/\*\!5001[7|3].*?`[^\*]*\*\/##g' dumpfile.sql