Skip to content

Instantly share code, notes, and snippets.

View bboyle's full-sized avatar

Ben Boyle bboyle

View GitHub Profile
@bboyle
bboyle / date input mockup
Created April 1, 2011 16:38
Mockup of date picker using lightbox shadowing to highlight the date field and its datepicker; the date picker includes two tables, the standard calendar picker and a decade/year/month navigation table (as seen in Windows 7)
<!DOCTYPE html>
<html>
<head>
<title>Example form with date input</title>
<style type="text/css">
html {
background: silver;
color: black;
font: 100%/1.3 Verdana, sans-serif;
}
@bboyle
bboyle / key-events.html
Created February 14, 2012 02:23
Finding javascript key codes aka "which" value — http://codepen.io/bboyle/pen/KwbRyQ
<!DOCTYPE html>
<html>
<head>
<title>key events</title>
<style>
body {
color: #111;
background: #f7f7f7;
font: 100%/1.3 Verdana, sans-serif;
@bboyle
bboyle / AB-test.js
Created July 8, 2014 05:02
Quick and dirty AB testing
(function( $ ) {
'use strict';
// split traffic between this page and a B-variant
function ABredirect( path, weight, variationFunction ) {
path = path || '/index.html';
weight = weight || 0.5;
// is this the B-variant?
if ( window.location.pathname.indexOf( path ) === -1 ) {
@bboyle
bboyle / gist:6bbe27f400911872bad7
Created July 23, 2014 04:31
Radial layout CSS
.key li {
position: absolute;
-webkit-transform-origin: 50% 90px 0 true 50%;
}
.key ul {
position: absolute;
-webkit-transform: translateX(-32px) translateY(-64px)
}
.key li:nth-child(1) {
@bboyle
bboyle / GraphEditorToggle
Created March 21, 2015 02:36
Open/close Maya graph editor (MEL script)
if (`window -q -ex graphEditor1Window`)
deleteUI graphEditor1Window;
else
tearOffPanel "Graph Editor" "graphEditor" true;
@bboyle
bboyle / stella-spine-select.mel
Created April 9, 2015 05:34
Stella spine selection
select -cl ;
select -r char_tribes_stella_shot_ready:stl_spine_fk_lower_ctrl ;
select -tgl char_tribes_stella_shot_ready:stl_spine_fk_upper_ctrl ;
select -tgl char_tribes_stella_shot_ready:stl_spine_fk_shoulder_ctrl ;
@bboyle
bboyle / gist:42993458e70a30631c78
Created May 8, 2015 11:38
AM rig issue: controllers animate but geometry is frozen
# caused by setting keys on hidden controls in the rig.
# To fix the problem, do this
select -r "char_*:*_local_ctrl"
# ...then select the whole timeline, and delete all the keys there. The pigtails should work again.
# The new "select all" script should be
select -r `ls -o "char_*:*_ctrl.arAllCtrlList"`;
@bboyle
bboyle / follow_cams.mel
Created May 13, 2015 15:33
Creates 4 follow cams attached to selected object. (Thanks to Nicole Herr at AnimationMentor for this!)
$object = `ls -sl`;
float $wsPivot[] = `xform -q -ws -rp $object`;
select -cl;
camera -n "Follow_Cam_Top" -hc "viewSet -p %camera";
camera -n "Follow_Cam_Persp" -hc "viewSet -t %camera";
Group; xform -t $wsPivot[0] $wsPivot[1] $wsPivot[2];
$GroupSel = `ls -sl`;
rename $GroupSel Follow_Cam_Constraint;
select "Follow_Cam_Top1";
@bboyle
bboyle / monokai.md
Last active November 6, 2016 10:27
Windows powershell colour schemes
Red Grn Blu Colour
39 40 34 Black
102 217 239 Cyan
166 226 46 Lime
102 217 239 Cyan
249 38 114 Red
249 38 114 Red
230 219 116 Yellow
207 207 194 Grey
@bboyle
bboyle / backup.cmd
Last active October 16, 2017 18:22
Super simple backup script for windows
CHCP 65001
robocopy /mir "D:\Users\foo" "E:\Users\foo"
robocopy /mir "C:\foo\bar" "E:\foo\bar"
pause