Skip to content

Instantly share code, notes, and snippets.

View hilukasz's full-sized avatar

Łukasz Wieczorek hilukasz

View GitHub Profile
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;
@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') );
doc = app.activeDocument;
sel = doc.selection[0];
var rotate;
var numberOfObjects;
var radius;
initWindow();
@hilukasz
hilukasz / timer.js
Last active August 29, 2015 14:06
afterEffectsTimer.js
Heavily modified code from: http://forums.creativecow.net/thread/227/12722
timeToStart = 4;
text.sourceText = "4:59";
if (time >= timeToStart){
clockStart = 300;
function padZero(n){
if (n < 10) return "0" + n else return "" + n
}
@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';
float x;
float easing = 0.05;
float targetX = origin;
float dx = targetX - x;
if(abs(dx) > 1) {
x += dx * easing;
}
me.addSeed = function(_r,_a) {
var r = _r || 0;
var a = _a || 0;
var seed = new FIB.GoldenSeed(0,0);
seed.radius = seed.tradius = r;
seed.angle = seed.tangle = a;
me.seeds.unshift(seed);
return seed;
};
/**************************************************************************
*
* @@@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