Skip to content

Instantly share code, notes, and snippets.

View markhalliwell's full-sized avatar
🦄
unicorns!

Mark Halliwell markhalliwell

🦄
unicorns!
  • Fort Worth, Texas, USA
View GitHub Profile
@markhalliwell
markhalliwell / shim-jspanel4.d.ts
Last active June 21, 2023 17:26
jspanel4 TypeScript declarations
declare module 'jspanel4' {
// Types.
export type IJSPanelAutoPosition = 'down' | 'left' | 'up' | 'right';
export type JSPanelContent<T = string | HTMLElement> = T;
export type IJSPanelContentArray<
TContent = string | HTMLElement,
> = IJSPanelDynamicContent<TContent>[] | JSPanelContent<TContent>;
export type JSPanelControlStatus = 'disable' | 'enable' | 'hide' | 'remove' | 'show';
export type IJSPanelDimension = number | string | IJSPanelCallback<number | string>;
export type IJSPanelDynamicContent<
#!/usr/bin/env bash
[ ! -d .git ] && "This is not a git directory." && exit 1
# Setup the gource info for the repo.
~/gource/setup
# Create the video.
gource --load-config ./.git/gource/config.ini | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 8 -bf 0 ./gource.mp4
@markhalliwell
markhalliwell / stark2.theme.php
Created July 8, 2014 15:45
Adding external/inline resources via #attached in a Drupal 8 theme
<?php
/**
* @file
* Example of how to attach external and inline resources for a theme via the
* #attached render array method in 8.x.
*/
/**
* Helper function for attaching resources to a render array.
*/
@markhalliwell
markhalliwell / cd-tests.sh
Created August 18, 2014 14:14
cocoaDialog Tests
#!/bin/bash
# Script: cocoaDialogTests.sh
# Author: Mark Carver
# Created: 2011-09-23
# Updated: 2012-07-24
# Copyright (c) 2012 Mark Carver. All rights reserved.
cocoaDialog(){
# Replace this with your path if it isn't installed in the applications folder.
/Users/Shared/Applications/cocoaDialog.app/Contents/MacOS/cocoaDialog "${@}";
@markhalliwell
markhalliwell / ViewsExposedForm.php
Created July 11, 2016 18:22
Drupal Bootstrap 8.x-3.x - Views Exposed Form Toggle
<?php
// In your sub-theme, create this file ./THEMENAME/src/Plugin/Preprocess/ViewsExposedForm.php and place this contents in it.
/**
* @file
* Contains \Drupal\THEMENAME\Plugin\Preprocess\ViewsExposedForm.
*/
namespace Drupal\THEMENAME\Plugin\Preprocess;
// Colors.
$color-map-variations: (
alpha: .95,
dark: 10%,
darker: 15%,
darkest: 20%,
light: 5%,
lighter: 10%,
lightest: 15%,
@markhalliwell
markhalliwell / sass-helper-classes.scss
Created January 27, 2015 18:52
SASS Helper Classes
// Helper classes.
@each $property in (border, margin, padding) {
@each $direction in ('', -left, -right, -top, -bottom) {
.#{$property}#{$direction} {
@if $property == border {
#{$property}#{$direction}: 1px solid $gray-lighter;
}
@else {
#{$property}#{$direction}: 1em;
}
@markhalliwell
markhalliwell / index.html
Last active November 7, 2016 16:25
Stand alone Dreditor UI patch reviewer
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Patch Review</title>
<link type="text/css" rel="stylesheet" href="/sites/all/libraries/prism/prism.css" media="all">
<link type="text/css" rel="stylesheet" href="/sites/all/libraries/dreditor/dist/css/dreditor.css" media="all">
<link type="text/css" rel="stylesheet" href="/sites/all/libraries/dreditor-ui/dist/css/dreditor-ui.css" media="all">
</head>
<body>
@markhalliwell
markhalliwell / SearchBlockForm.php
Last active October 29, 2016 00:51 — forked from lanoxx/bootstrap_subtheme.theme
Support placing the navbar into the top navigation
<?php
namespace Drupal\bootstrap_mobildata\Plugin\Form;
use Drupal\bootstrap\Annotation\BootstrapForm;
use Drupal\bootstrap\Utility\Element;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter().
*
@markhalliwell
markhalliwell / gist:5249012
Last active March 11, 2016 11:44
Redirect local sand-boxed Drupal file requests to a development server. This helps avoid having to sync (sometimes, very huge) file structures onto your local machine.
### Apache Rewrite
# Request resides in your 'sites/default/files' folder.
RewriteCond %{REQUEST_URI} ^/sites/default/files/(.*)$
# File doesn't exist.
RewriteCond %{REQUEST_FILENAME} !-f
# Directory doesn't exist.
RewriteCond %{REQUEST_FILENAME} !-d
# Redirect request to your development or production server.
RewriteRule ^/sites/default/files/(.*)$ http://dev.example.com/sites/default/files/$1 [L]