Skip to content

Instantly share code, notes, and snippets.

@cameronmcefee
cameronmcefee / gist:2641743
Created May 9, 2012 04:14
Font Configuration File
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"expert","formats":["ttf","woff","eot","svg"],"tt_instructor":"default","options_subset":"advanced","subset_custom":"","subset_custom_range":"f000-f073,f200-f273","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0","rememberme":"Y"}
@cameronmcefee
cameronmcefee / gist:3042886
Created July 3, 2012 20:38
Ghetto Photoshop Panel Dev Guide
Here's what I told the last person that asked about how to get started with Photoshop panel development. One day I'll write a good version of this.
I'll warn you, Photoshop development is a real headache. There is a lot of stuff to try to figure out, but stick with it! It's worth it.
Is the flex part Easy , i mean the interaction part (the interface build must be easy)
Flex is basically XML. You can create most of it by dragging and dropping components if you don't want to customize the UI.
So during the install you install the panel plus a script ?
Essentially yes. For the most basic panel there is a panel file (.swf), script file (.jsx), and icon files (.png). You can even do the panel without the script file, though doing so limits you mostly to CS5.
@cameronmcefee
cameronmcefee / Crier.as
Created August 24, 2012 17:05
Variable passing for Photoshop panels
package classes {
import com.adobe.csxs.core.CSXSInterface;
import com.adobe.csxs.events.*;
import com.adobe.csxs.external.resources.*;
import com.adobe.csxs.types.*;
import com.adobe.serialization.json.JSON;
import flash.display.Sprite;
/*
o----------------------o----------------------o
CAMERON McEFEE | 530.339.8372
New Media Designer | [email protected]
o----------------------o----------------------o
Thanks for looking!
Duplicate-To-All is a Photoshop script by Cameron McEfee.
@cameronmcefee
cameronmcefee / gist:3710864
Created September 12, 2012 23:58
How to make one history state in Photoshop
// Suspend history logging so the grid can run as one history state
//
// p - params for renderGuides(). Not used in this method.
//
// Returns void
function execGuideGuide(p){
app.activeDocument.suspendHistory("GuideGuide!", "renderGuides(p)")
}
@cameronmcefee
cameronmcefee / gist:4439382
Created January 2, 2013 23:32
Here's a snipped from my ui color switcher. Right now it's dependent on the CSXSInterface to get the info. I need to figure out if there's a way to get the info without it.
// Get the color from the app
var i:Number = 0;
var uiObjects:Array = new Array();
var uiResult:SyncRequestResult = CSXSInterface.instance.getHostEnvironment();
var hostData:HostEnvironment = uiResult.data;
var skinInfo:AppSkinInfo = hostData.appSkinInfo;
var appUILightness:Number;
// Color value from the ui
defaultColor = skinInfo.panelBackgroundColor.color.rgb;
@cameronmcefee
cameronmcefee / ApplicationSkin.as
Last active December 11, 2015 11:49
Here's how I detect Photoshop's skin color and set my assets/colors accordingly
package classes {
public class ApplicationSkin {
import com.adobe.csxs.core.CSXSInterface;
import com.adobe.csxs.types.AppSkinInfo;
public function ApplicationSkin() {}
// The current lightness of the app's background on a scale of 0-1
//
// Returns a Number
@cameronmcefee
cameronmcefee / ps-dev-references.md
Last active January 26, 2016 09:48
Here's a list of resources I provide people when they want to start looking into Photoshop development.

Sites and tools

Roughly ordered by functional (not skill level) simplicity, that is they go from simple (basic scripting) to complex (full Photoshop Extensions).

  • Photoshop Script reference - Start here for all your scripting needs. Check out the script listener plugin too. It outputs anything you do in Photoshop as Javascript.
  • Adobe Configurator - Build quick (but simple) panels. Basically GUI interface for scripts.
  • Adobe Photoshop Scripting and SDK forums. Somewhat helpful for scripting/extension building. Don't expect quick answers.
  • PS-Scripts - Another semi-helpful forum
  • Photoshop CS5 Panel Developer's Guide - Hard to find now. I don't think they made one for CS6, but it's still releveant for so
@cameronmcefee
cameronmcefee / environment_variables.rb
Created June 19, 2018 15:59
A Jekyll plugin to load all environment variables that start with "JEKYLL_" into the Jekyll config
module Jekyll
class EnvironmentVariablesGenerator < Generator
# Pass any environment variables that start with JEKYLL_ on to Jekyll, where
# they can be access on the `site` object, like {{ site.JEKYLL_MY_VAR }}
def generate(site)
keys = ENV.keys.select { |i| i[/^JEKYLL_/] }
keys.each { |k| site.config[k] = ENV[k] }
end
@cameronmcefee
cameronmcefee / ! Use Sentry with Astro.md
Last active June 21, 2023 11:19
Here's a way to get Sentry working in framework components with Astro.

This example isn't comprehensive, so you can't just copy and paste. However, it should be a good template to base your own solution off. I chose to use React but you can use any framework.

Note: Sentry has a Vite plugin. As of Astro 1.9.0, Astro runs Vite plugins twice during the build process, which results in map files being submitted twice. Until this is resolved, it doesn't seem like an acceptable solution.