Skip to content

Instantly share code, notes, and snippets.

// In the TypeTool, the StyleRun defines all of the different styles
// that are applied to a text layer. Each style is defined in the RunArray,
// and the character indices for each style is defined in the RunLengthArray,
// i.e. the first style exists for 7 characters, the 2nd for 7 characters,
// and the third for 10 characters.
> typeTool.engineData.EngineDict.StyleRun
{ DefaultRunData: { StyleSheet: { StyleSheetData: {} } },
RunArray:
[ { StyleSheet: [Object] },
{ StyleSheet: [Object] },
@durandom
durandom / pre-commit.rb
Created July 7, 2016 12:52
git pre-commit hook that runs rubocop on staged files
#!/usr/bin/env ruby
# make sure you have gem 'rubocop-git' in your Gemfile
require 'readline'
def input(prompt="", newline=false)
prompt += "\n" if newline
Readline.readline(prompt, true).squeeze(" ").strip
end