Skip to content

Instantly share code, notes, and snippets.

View dtex's full-sized avatar
:octocat:
Shifting bits

Donovan Buck dtex

:octocat:
Shifting bits
View GitHub Profile
@dtex
dtex / gist:4111574
Created November 19, 2012 16:19
slipNSlide effect for jQuery Tools tabs
/*
This custom tabs effect will close one accordion and then open the other
as opposed to trying to do both at the same time like "slide"
*/
$.tools.tabs.addEffect("slipNSlide", function(i, done) {
var conf = this.getConf();
if(this.getCurrentTab().length !== 0) {
this.getPanes().slideUp(conf.slideUpSpeed);
window.setTimeout( function(that, conf){
that.getPanes().eq(i).slideDown(conf.slideDownSpeed, done);
@dtex
dtex / gist:4172640
Created November 29, 2012 23:30
HTML5 Form placeholder shim
// Uses Modernizr and jQuery
if(!Modernizr.input.placeholder) {
jQuery("input[placeholder]").focus(
function () { if (this.value == jQuery(this.attr('placeholder')) this.value = ''; }
).blur(
function () { if (this.value == '') this.value = jQuery(this.attr('placeholder')); }
);
}
@dtex
dtex / gist:4337176
Created December 19, 2012 14:49
Onion skinning plugin for jQuery
(function( $ ){
var methods = {
init : function( options ) {
return this.each(function(){
oSkin = $('<div class="onionSkin" style="width:100%;text-align:center;position:absolute;opacity:.5;display:none;" />');
oImg = $('<img src="'+options.src+'" />');
oImg.css(options.imgStyles);
@dtex
dtex / gist:5766397
Last active December 18, 2015 10:09
Miguel, In this example getInventory() is a function that simply loops through all the rows of a result set and output a <tr> for each one.
<%
if (Request["type"] == "inventorySpreadsheet") {
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=inventory.xls");%>
<table class="datatable" border="1">
<thead>
<tr>
<th>Description</th>
<th>Lot/Receiver</th>
<th>Qty On Hand</th>
@dtex
dtex / gist:6251952
Last active December 21, 2015 04:48
Install libxml2 using homebrew
homebrew 0.9
brew install libxml2 libxslt
brew link libxml2 libxslt
function walk(dir) {
if (!dir) {
dir = "fwd";
}
if (task) {
task.stop();
}
function walk(dir) {
if (!dir) {
dir = "fwd";
}
if (task) {
task.stop();
}
@dtex
dtex / gist:9140728
Last active August 29, 2015 13:56
Walk with animateGroup
function walk(dir) {
if (!dir) {
dir = "fwd";
}
if (task) {
task.stop();
}
Servo.animateGroup({
@dtex
dtex / gist:9157009
Created February 22, 2014 15:54
with servoGroup Constructor
var legs = new ServoGroup([
lf.coxa, lf.femur, lf.tibia, lb.coxa, lb.femur, lb.tibia,
rf.coxa, rf.femur, rf.tibia, rb.coxa, rb.femur, rb.tibia
]);
legs.animate({
cuePoints: [0.125, 0.5, 0.625, 1.0],
duration: 2000,
timeline: [
[82, dir === "fwd" ? 130 : 82, 103, 103],
@dtex
dtex / keybase.md
Last active August 29, 2015 14:06
keybase.md

Keybase proof

I hereby claim:

  • I am dtex on github.
  • I am dtex (https://keybase.io/dtex) on keybase.
  • I have a public key whose fingerprint is BA49 182A 30C8 8425 2568 8C68 5DA1 EF20 F272 C2CB

To claim this, I am signing this object: