Skip to content

Instantly share code, notes, and snippets.

View Arahnoid's full-sized avatar

Igor Grinchesku Arahnoid

  • Chernivtsi, Ukraine
View GitHub Profile
@Arahnoid
Arahnoid / gist.ahk
Created August 12, 2013 22:37 — forked from maestrith/gist.ahk
testing
access_token:="" ;Your Github access token goes here if you want to publish it to your Gist list
info:="Code to post goes here" ;Change this to create the new text for the Gist
filename:="mygit.txt" ;change this to whatever you want your file name to be
desc:="my description" ;This is where you would have a description for your Gist
post_gist(info,access_token,filename,desc)
return
var doc = app.activeDocument;
var guides = app.activeDocument.guides;
var w = doc.width;
var h = doc.height;
function MakeGuidesGrid(numVerticalGuides, gutterVertical, numHorisontalGuides, gutterHorisontal) {
if (numHorisontalGuides !== 0) {
var j = h / numHorisontalGuides;
for (var i = 0; i < numHorisontalGuides; i++) {
guides.add(Direction.HORIZONTAL, j * i);
var doc = app.activeDocument;
var guides = app.activeDocument.guides;
var w = doc.width;
var h = doc.height;
function MakeGuidesGrid(unitVertical, gutterVertical, unitHorisontal, gutterHorisontal) {
if (unitHorisontal !== 0) {
var j = h / unitHorisontal;
for (var i = 0; i < j; i++) {
guides.add(Direction.HORIZONTAL, i * unitHorisontal);
@Arahnoid
Arahnoid / layersOrder.js
Last active April 21, 2019 23:20 — forked from vladocar/layersOrder.js
[Sort A-Z] Sort Photoshop layers alphabeticaly #Photoshop
function sortLayerAZ (layerList) {
var layers;
// check if layer list is provided
if (layerList) {
layers = layerList;
} else {
layers = activeDocument.layers;
}
var len = layers.length;
var layerNum = app.activeDocument.layers.length;
var arr = [];
for (var i = 0; i < layerNum; i++) {
arr[i] = '"'+app.activeDocument.layers[i].name+'"';
}
// taken from: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array
var sorted_arr = arr.sort(); // You can define the comparing function here.
@Arahnoid
Arahnoid / layerNames.js
Last active April 21, 2019 22:47 — forked from vladocar/layerNames.js
[Get list of layer names] #Photoshop
var layerNum = app.activeDocument.layers.length;
var a = [];
for (var i = 0; i < layerNum; i++) {
a[i] = '"' + app.activeDocument.layers[i].name + '"';
}
prompt("Layers Names:", a);
var layerNum = app.activeDocument.layers.length;
prompt("Layers Number:", layerNum);
/*******************************************************************************
1. DEPENDENCIES
*******************************************************************************/
var gulp = require('gulp'); // gulp core
sass = require('gulp-sass'), // sass compiler
uglify = require('gulp-uglify'), // uglifies the js
jshint = require('gulp-jshint'), // check if js is ok
rename = require("gulp-rename"); // rename files
concat = require('gulp-concat'), // concatinate js
@Arahnoid
Arahnoid / DrawShape.js
Created November 4, 2015 18:03 — forked from vladocar/DrawShape.js
Draw Shape in Photoshop with JavaScript
/* Code by Mike Hale http://www.ps-scripts.com/bb/viewtopic.php?f=14&t=1802&start=15
with small modification by Vladimir Carrer
*/
function DrawShape() {
var doc = app.activeDocument;
var y = arguments.length;
var i = 0;
@Arahnoid
Arahnoid / ps-export-layers-to-png.jsx
Last active April 21, 2019 23:20 — forked from tomekc/ps-export-layers-to-png.jsx
[Export .png layers] Photoshop script that exports to PNG all layers and groups whose names end with ".png". #Photoshop
#target photoshop
// $.level = 2;
/*
* Script by Tomek Cejner (tomek (at) japko dot info)
* based on work of Damien van Holten:
* http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/
*
* My version adds support of nested layer groups,
* and exports single layers in addition to groups.