Skip to content

Instantly share code, notes, and snippets.

View hilukasz's full-sized avatar

Łukasz Wieczorek hilukasz

View GitHub Profile
@hilukasz
hilukasz / Selected_layers-PS.jsx
Last active July 12, 2023 15:52
get array of selected layers in photoshop via extendscript
var docRef = app.activeDocument;
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function newGroupFromLayers(doc) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putClass( sTID('layerSection') );
@hilukasz
hilukasz / unlockAllLayers_Photoshop.jsx
Last active February 11, 2022 22:32
unlockAllLayers_Photoshop
// save as unlockAllLayers_Photoshop.jsx and put it in your scripts folder to see it in File > Scripts
var topLayer = app.activeDocument.layers[0];
app.activeDocument.activeLayer = topLayer;
do{
unlockLayer();
selectLayerBelow();
}while(topLayer != app.activeDocument.activeLayer)
function unlockLayer(){
if(app.activeDocument.activeLayer.isBackgroundLayer ) app.activeDocument.activeLayer.name = 'From Background';
@hilukasz
hilukasz / removeEmptyTextBoxes.jsx
Last active January 19, 2022 10:50
delete empty text boxes in illustrator
// Written By Łukasz Wieczorek - hellowoo.com
// you can destribute this freely via creative commons(http://creativecommons.org/licenses/by-sa/3.0/)
// but leave this message in tact, or give credit to original script.
var numberOfEmptyTextBoxes = 0;
var layersWithNoText = new Array();
if ( app.documents.length > 0 ) {
for ( i = 0; i < app.activeDocument.textFrames.length; i++ ) {
text = app.activeDocument.textFrames[i].textRange;
numWords = app.activeDocument.textFrames[i].words.length;
<nav>
<div class="menu-main-container"><ul id="menu-main" class="menu"><li id="menu-item-19" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-19"><a href="http://localhost/tigerstudiov2/?page_id=5">Work</a></li>
<li id="menu-item-18" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18"><a href="http://localhost/tigerstudiov2/?page_id=7">Company</a>
<ul class="sub-menu">
<li id="menu-item-21" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-21"><a href="#">test sub-item</a></li>
<li id="menu-item-22" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-22"><a href="#">item 2</a></li>
<li id="menu-item-23" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-23"><a href="http://adf">asfdasf</a></li>
<li id="menu-item-24" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-24"><a href="http://asdfasf">asdfasf</a></li>
</ul>
</li>
/**************************************************************************
*
* @@@BUILDINFO@@@ 00globals-2.jsx 3.5.0.43 20-November-2009
* ADOBE SYSTEMS INCORPORATED
* Copyright 2010 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying it.
* If you have received this file from a source other than Adobe, then your
int soundSensor = A1;
int relay = A2;
int relay2 = A3;
int relay3 = A4;
int relay4 = A5;
int claps = 0;
long detectionSpanInitial = 0;
long detectionSpan = 0;
boolean lightState = false;
int soundSensor = A2;
int relay = A0;
int relay2 = A3;
int relay3 = A4;
int relay4 = A5;
int claps = 0;
long detectionSpanInitial = 0;
long detectionSpan = 0;
boolean clapState = false;
int doubleClap = 0;
@hilukasz
hilukasz / gist:90c1e8b96b645b9cba1c
Last active February 3, 2016 04:32
clapsensor.cpp
int soundSensor = A2;
int relay = A0;
int relay2 = A3;
int relay3 = A4;
int relay4 = A5;
int claps = 0;
long detectionSpanInitial = 0;
long detectionSpan = 0;
boolean clapState = false;
int doubleClap = 0;
var colorDepth = ["red", "green", "blue"];
node.append("circle")
.attr("r", function (d, idx) { return 6 / d.depth; })
.attr( "class", colorDepth[function (d, idx) { return d.depth }]);
#include "motionTracker.h"
MotionTracker::MotionTracker(){
debugIsOn = false;
closestSensorIndex = 0;
}
void MotionTracker::setDebugOn(){
debugIsOn = true;