Skip to content

Instantly share code, notes, and snippets.

View mim-Armand's full-sized avatar
🔦
Kugelblitz!

Armand mim-Armand

🔦
Kugelblitz!
View GitHub Profile
// 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',
@mim-Armand
mim-Armand / objToArray.js
Last active August 29, 2015 14:04
getting an array of Object properties in older Versions of JavaScript
Object.objToArray = function(obj) {
var array = [];
for (key in obj) {
if (obj.hasOwnProperty(key)) array.push(key);
}
return array;
};
alert(Object.objToArray(YourObject));
@mim-Armand
mim-Armand / Conemu_startup_v1
Created August 23, 2016 17:27
An startup script for my conemu
-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
@mim-Armand
mim-Armand / setinterval_extendscript_v0.01.js
Last active September 15, 2017 04:33
setinterval for adobe extend script v 0.1
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:
// 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;