View units_in_extendScript.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://armand.eu/blog/working-with-measurement-units-in-adobe-extendscript/ | |
function changeUnitsToPixels(){ | |
if(typeof originalUnitsH === 'undefined') originalUnitsH = app.documents[0].viewPreferences.horizontalMeasurementUnits; | |
if(typeof originalUnitsV === 'undefined') originalUnitsV = app.documents[0].viewPreferences.verticalMeasurementUnits; | |
app.documents[0].viewPreferences.horizontalMeasurementUnits = app.documents[0].viewPreferences.verticalMeasurementUnits = MeasurementUnits.pixels; | |
} | |
function changeUnitsBack(){ | |
app.documents[0].viewPreferences.horizontalMeasurementUnits = originalUnitsH; |
View setinterval_extendscript_v0.01.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(); | |
function main() { | |
var myIdleTask = app.idleTasks.add({ | |
name: “my_idle_task”, | |
sleep: 1000 | |
}); | |
var onIdleEventListener = myIdleTask.addEventListener(IdleEvent.ON_IDLE, onIdleEventHandler, false); | |
} | |
// SETINTERVAL DOSNT EXIST SO WE USE THE ONLY POSSIBLE WAY ONIDLE EVENT: |
View Conemu_startup_v1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-cur_console:t:'GIT' bash | |
-new_console:s1T50V -cur_console:t:"2b" powershell -NoExit -command [enum]::GetValues([System.ConsoleColor]) | Foreach-Object {Write-Host $_ -ForegroundColor $_}; cd desktop; netstat 333; | |
-new_console:s1T50H -cur_console:t:"3b" powershell -NoExit -command Write-Output 'Good morining mim!' -v; Write-Warning 'Main PS console'; $colors = $host.PrivateData; $colors.VerboseForegroundColor = 15; $colors.VerboseBackgroundColor = 9;$colors.WarningForegroundColor = 14; $colors.WarningBackgroundColor = 2; $colors.ErrorForegroundColor = 15; $colors.ErrorBackgroundColor = 12; cd desktop; | |
-new_console:s2T50H -cur_console:t:"4b" far C:/Users/mim/Desktop | |
-new_console:s2T50H -cur_console:t:"W1" powershell -NoExit -command Write-Verbose 'Goodmorining mim!' -v; $console = $host.UI.RawUI;$console.ForegroundColor = 15;$console.BackgroundColor = 1; start-sleep 3; $colors = $host.PrivateData; $colors.VerboseForegroundColor = 15; $colors.VerboseBackgroundColor = 9;$colors.WarningForegroundColor = 14; $col |
View Object.keys.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys | |
if (!Object.keys) { | |
Object.keys = (function () { | |
'use strict'; | |
var hasOwnProperty = Object.prototype.hasOwnProperty, | |
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), | |
dontEnums = [ | |
'toString', | |
'toLocaleString', | |
'valueOf', |
View objToArray.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.objToArray = function(obj) { | |
var array = []; | |
for (key in obj) { | |
if (obj.hasOwnProperty(key)) array.push(key); | |
} | |
return array; | |
}; | |
alert(Object.objToArray(YourObject)); |
View jsx_reflection.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = this; | |
var t = ''; | |
var props = f.reflect.properties; | |
for (var i = 0; i < props.length; i++) { | |
t += ('this property ' + props[i].name + ' is ' + f[props[i].name] + "\n"); | |
} | |
alert(t); |
View processing_titlebar_icon.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
ImageIcon titlebaricon = new ImageIcon(loadBytes("myicon.png")); | |
frame.setIconImage(titlebaricon.getImage()); | |
} |
View AES_path_01.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myPath = app.activeDocument.filePath; | |
alert(myPath); |
View AES_path_02.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/'); | |
alert(myPath); |
View Hashgrid_00.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HashGrid { | |
float bucketSize; | |
int gridWidth, gridHeight, bucketLength, numberOfRows, numberOfCols; | |
HashGrid(float bucketSize_, int gridWidth_, int gridHeight_, int bucketLength_) { | |
} | |
void set(Points point_) { //TODO: it is better probably to use an interface instead of hardcoding it but for now! ... | |
} | |
Points[] get(PVector location_) { | |
Points[] answer = new Points[answerLength]; |
NewerOlder