Skip to content

Instantly share code, notes, and snippets.

View kyletaylored's full-sized avatar
🍝
unfurling wet spaghetti

Kyle Taylor kyletaylored

🍝
unfurling wet spaghetti
View GitHub Profile
@kyletaylored
kyletaylored / Adobe Kuler Color & Drupal
Last active August 29, 2015 14:05
Adobe Kuler & Drupal: Color theme integration
<?php
// Add this to the bottom of color.inc.
// The color fields will differ on themes, so you'll need to make sure
// to update the field names for the colors.
// ie, brandprimary, brandsecondary, etc.
// Add Kuler colors
$kuler_json = theme_get_setting('kuler_json', variable_get('theme_default'));
$kuler_check = theme_get_setting('kuler_check', variable_get('theme_default'));
server {
listen 8080 default_server;
listen [::]:8080 default_server ipv6only=on;
root /var/www/html/drupal;
index index.php index.html index.htm;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
@kyletaylored
kyletaylored / Drupal Bootstrap 2 Navigation Hack
Created January 30, 2015 01:49
Bootstrap 2 mobile navigation hack
Drupal.behaviors.themeMobileNavigation = {
attach: function(context, settings) {
// Menu
var header = $('#header', context);
header.once('menu', function(){
var menu = $('#menu', header);
var menuToggle = $('.mobile-menu a.toggle', header);
var ul = $('ul.menu.nav, .menu-block-wrapper > ul.menu', menu);
if (menu.length && menuToggle.length && ul.length) {
menuToggle.click(function(){
@kyletaylored
kyletaylored / Mac Command Prompt
Created January 6, 2016 07:55
A better command prompt for Mac, including git status of current directory.
function directory_size () {
# Sum the number of bytes in a directory listing
size=$(ls -l | awk 'BEGIN {x=0} NR > 1 {x+=$5} END {
split("B KB MB GB TB PB",type);
if (x > 0) {
for(i=5;y < 1;i--) {
y = x / (2**(10*i));
}
}
printf "%.2f %s", y, type[i+2]
@kyletaylored
kyletaylored / Remove all git tags
Created July 11, 2016 20:08 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@kyletaylored
kyletaylored / 1-extract-breakpoint.less
Last active August 24, 2016 15:13
Bootstrap 2 grid options (from Bootstrap 3)
// -----------------------------------------
// Bootstrap 2 related variables / functions
// -----------------------------------------
@mobile: ~"(max-width: 767px)";
@tablet: ~"(min-width: 768px) and (max-width: 979px)";
@normal: ~"(min-width: 980px) and (max-width: 1199px)";
@wide: ~"(min-width: 1200px)";
@gridColumns: 12;
@gridColumnWidth: 60px;
@kyletaylored
kyletaylored / drupal-7-uninstall-module-checkboxes.js
Created January 20, 2017 20:17
A one-liner to run in your console when you need to uncheck many modules on the uninstall screen.
[...document.querySelectorAll(".form-type-checkbox input.form-checkbox:not([disabled])")].forEach(checkbox => checkbox.checked=true);
@kyletaylored
kyletaylored / Pivotal stories finished by user
Last active March 27, 2017 14:16
Show all accepted Pivotal Tracker stories for specific user
For example, Kyle Taylor (kt)
owner:kt AND state:accepted
@kyletaylored
kyletaylored / optimize_images.sh
Last active June 10, 2017 15:33
Script to run in a local directory to optimize all JPG and PNG images.
#!/bin/bash
# This script relies on jpegtran, a tool included with libjpeg.
# libjpeg comes bundled with ImageMagick on most nix platforms:
#
# Mac:
# brew install imagemagick
# brew install pngquant
#
# Ubuntu/Debian:
---
version: "2"
plugins:
duplication:
enabled: true
config:
languages:
php:
mass_threshold: 45
eslint: