Skip to content

Instantly share code, notes, and snippets.


James Wilson jameswilson

View GitHub Profile
jameswilson / responsive-modal.css
Last active Mar 5, 2021
Drupal Ctools Responsive Modal
View responsive-modal.css
/* Override inline dom styles from modal.js */
#modalContent {
position: fixed !important;
top: 12% !important;
bottom: 12% !important;
right: 4% !important;
left: 4% !important;
/* Limit max width to 1000px */
div.ctools-modal-content {
jameswilson / pager.tpl.php
Last active Aug 19, 2020
Drupal 7 Accessible Pager (Backport from Drupal 8)
View pager.tpl.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.
jameswilson /
Last active Aug 17, 2020
Integrate Drupal 8 Toolbar w/ Bootstrap Fixed Top Nav
# Improve interoperability between MyTheme and the Drupal admin toolbar.
- mytheme/toolbar
jameswilson / Code.js
Last active Mar 10, 2020
Google Sheets XHR insert via GET request, respond with JSON status.
View Code.js
* @file
* Google Sheets XHR insert script.
* From:
* Setup instructions:
* 1. Create a new Google Sheet and add column names in Row 1.
* 2. Click "Tools" > "Script editor" from the toolbar.
jameswilson / .gitconfig
Created Feb 15, 2017
git tree - a shorthand alias for a pretty cli git log graph
View .gitconfig
# Place this in your home directory's ~/.gitconfig file
# a shorthand alias for a pretty cli git log graph
tree = "!git log --graph --decorate --pretty=format:'%C(yellow)%h %Cred%cr %Cblue(%an)%C(cyan)%d%Creset %s' --abbrev-commit --all"
jameswilson / localized_placeholder_node_and_menu_item.php
Created Aug 25, 2014
Programmatically create a placeholder node with translations and localized main menu links.
View localized_placeholder_node_and_menu_item.php
// The following code snippet is used to add a placeholder page and companion
// localized menu items to a site with i18n_menu and entity_translation enabled.
* Create an About page.
function mymodule_create_about_page() {
// Config data.
jameswilson / jquery.custom.fluiddialog.js
Created May 12, 2017
A script to make the jquery-ui dialog Responsive.
View jquery.custom.fluiddialog.js
* Custom script to make jquery-ui dialog responsive.
(function ($) {
"use strict";
function fluidDialog() {
var $visible = $(".ui-dialog:visible");
jameswilson /
Last active Mar 9, 2018 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git checkout old_branch_name # Ensure you're on the local branch.
git branch -M new_branch_name # Rename branch locally.
git branch --unset-upstream # unset
git push origin :old_branch_name # Delete the old branch
git push -u origin new_branch_name # Push the new branch, set local branch to track the new remote
jameswilson / node.html.twig
Created Jan 25, 2018
Drupal 8 has_page_title
View node.html.twig
* @file
* Theme override to display a node.
* Available variables:
* - see Stable Theme's node.twig.html for standard variables.
* - has_page_title: Flag for page title block visibility. Will be true when
* the iu_page_title block is present on the page. This is useful to add the
* H1 inside the article when page title block not present.
jameswilson / git-mdiff
Last active Sep 22, 2017
Git list merged branches in one branch, but not on another
View git-mdiff
# Git command to compare which branches are merged into one branch but not
# present in another. Useful for comparing which branches have been merged
# into a release branch that are already on the mainline branch.
# Usage:
# git mdiff origin/master origin/integration