Skip to content

Instantly share code, notes, and snippets.

Mark Carver markcarver

Block or report user

Report or block markcarver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View create.sh
#!/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
@markcarver
markcarver / ViewsExposedForm.php
Created Jul 11, 2016
Drupal Bootstrap 8.x-3.x - Views Exposed Form Toggle
View ViewsExposedForm.php
<?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;
@markcarver
markcarver / cd-tests.sh
Created Aug 18, 2014
cocoaDialog Tests
View cd-tests.sh
#!/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 "${@}";
View _colors.scss
// Colors.
$color-map-variations: (
alpha: .95,
dark: 10%,
darker: 15%,
darkest: 20%,
light: 5%,
lighter: 10%,
lightest: 15%,
View sass-helper-classes.scss
// 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;
}
@markcarver
markcarver / index.html
Last active Nov 7, 2016
Stand alone Dreditor UI patch reviewer
View index.html
<!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>
@markcarver
markcarver / SearchBlockForm.php
Last active Oct 29, 2016 — forked from lanoxx/bootstrap_subtheme.theme
Support placing the navbar into the top navigation
View SearchBlockForm.php
<?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().
*
@markcarver
markcarver / gist:5249012
Last active Mar 11, 2016
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.
View gist:5249012
### 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]
@markcarver
markcarver / rsync-progress.sh
Last active Jan 22, 2016
This only really works if rsyncing entire folders. Single files do work, however it will just appear to stand still (no progress). Also, change the path to cocoaDialog accordingly.
View rsync-progress.sh
#!/bin/bash
# cocoaDialog Rsync Progress
#
# Rsync files using the cocoaDialog progress bar. Example usage:
# $ rsync -avr --progress ~/source ~/destination | ./rsync-progress.sh
#
# Copyright (C) 2014 Mark Carver
#
# Adapted from Kevin Hendricks example code
View theme.php
<?php
return array(
'#theme' => 'table__forum_list',
'#theme_wrappers' => array('container__suggestion'),
'#attributes' => array(
'class' => array('extra-class', 'even-more-classes'),
'id' => 'i-am-unique',
'data-toggle' => 'tooltip',
),
You can’t perform that action at this time.