Skip to content

Instantly share code, notes, and snippets.

View dvschultz's full-sized avatar

Derrick Schultz (he/him) dvschultz

View GitHub Profile
@dvschultz
dvschultz / gist:e760cb048357bd859351
Last active August 29, 2015 14:06
story splitter that skips modal and assumes you want split before :)
/*
---------------------------------------------------------------------- --------------------------------------------
StorySplitter
---------------------------------------------------------------------- --------------------------------------------
An InDesign CS/CS2/CS3 JavaScript by FourAces
© The Final Touch 2006
Version 3.0.0
Splits the selected Story to separate Text Frames, while maintaining their contents.
@dvschultz
dvschultz / unused_styles.jsx
Created September 8, 2014 21:18
run checkForUnusedStyles() and it will remove all unused styles in your documents
function checkForUnusedStyles() {
var currDoc = app.activeDocument;
var myParStyles = currDoc.paragraphStyles;
for (i = myParStyles.length-1; i >= 2; i-- ){
removeUnusedStyle('paragraph',myParStyles[i])
}
var myCharStyles = currDoc.characterStyles;
for (i = myCharStyles.length-1; i >= 2; i-- ){
removeUnusedStyle('character',myCharStyles[i])
//originally published here: http://www.pdsassoc.com/downloads/ReassertParaStyles.js.zip
//rewritten to be CC compliant
//DESCRIPTION: Visit all paragraphs in document and reassert paragraph styles
myStyles = app.activeDocument.allParagraphStyles;
app.findTextPreferences = null;
app.changeTextPreferences = null;
for (var n = 1; myStyles.length > n; n++){
app.findTextPreferences.appliedParagraphStyle = myStyles[n];
app.changeTextPreferences.appliedParagraphStyle = myStyles[n];
@dvschultz
dvschultz / gist:8692837
Created January 29, 2014 17:30
eBook hyphens
-epub-hyphens: none;
adobe-hyphenate: none;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
-o-hyphens: none;
hyphens: none;
@dvschultz
dvschultz / poem.html
Last active January 2, 2016 17:49 — forked from elmimmo/poem.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Styling a poem</title>
<style type="text/css">
html,body {
height: 100%;
width: 100%;
}
@dvschultz
dvschultz / gist:8324974
Created January 8, 2014 21:26
Media Queries: Kindle Fire vs Kindle e-ink.
@media screen and (device-aspect-ratio:1/1) {
/* anything in here will work on Fires. Seriously. */
}
@media not all and (device-aspect-ratio:1/1) {
/* anything in here will work on e-inks */
}
@dvschultz
dvschultz / gist:7611132
Created November 23, 2013 05:23
.jsx-ify mustache
/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
/*global define: false*/
/*
* This had to be altered from normal mustache.js to work with adobe DOM
@dvschultz
dvschultz / gist:7360953
Created November 7, 2013 20:02
ibooks javascript to determine which device you’re using ibooks on #eprdctn
$(document).ready(function() {
(function(){
//cache variables
var iw = $('html').width(),
wh = screen.height;
alert('screen height: '+ wh +', inner-width: ' + iw);
if (wh == 768 || wh == 1024) {
@dvschultz
dvschultz / gist:7360480
Created November 7, 2013 19:28
#epdrctn psuedoselectors
p.whatever-class-it-is {
position: relative;
text-align: center;
padding: 1.5em 0; //this controls the spacing between the rules
}
p.whatever-class-it-is:after, p.whatever-class-it-is:before {
content: '';
position: absolute;
left: 0;
@dvschultz
dvschultz / gist:5918194
Last active December 19, 2015 07:19
These styles will hide the Yahoo bar of ugly from Flickr.com
#eyebrow-wrap {
display: none;
}
body.with-eyebrow #global-nav {
top: 0 !important; /* might need an !important for Safari or Chrome */
}