Skip to content

Instantly share code, notes, and snippets.

View amolok's full-sized avatar

amolok amolok

  • Saint Petersburg, Russia
View GitHub Profile
@amolok
amolok / fr.jsx
Created July 1, 2014 11:23
Creating sprites stack for ALASKA/ZLATA
#target Photoshop
var sourcePath = "H:/Projects/Alaska FullHD/Source/Animation/Bonus/"
var footageLength = 8;
var exportOptions = new BMPSaveOptions();
exportOptions.alphaChannels = false;
exportOptions.depth = BMPDepthType.TWENTYFOUR;
/*
@amolok
amolok / draw.c
Created October 15, 2014 08:19
Столбоскоп
// чтение шрифтов с флэшки
void mem_fnt_p_inc(void){
if( (++nand_fnt_p.shift) >= (NAND_PAGE_SIZE + NAND_SPARE_SIZE)){
nand_fnt_p.shift=0;
if( (++nand_fnt_p.page) >= NAND_BLOCK_SIZE){
nand_fnt_p.page=0;
if( (++nand_fnt_p.block) >= NAND_MEMORY_SIZE){
nand_fnt_p.block=0;
}
@amolok
amolok / export ALASKA Controls.js
Created October 15, 2014 10:36
ALASKA / ZLATA
#target Illustrator
/* export ALASKA Controls
*/
d = app.activeDocument;
var filePath = d.path;
var exportPath = '/Source/Controls/';
var fileName = d.name.split('.', 1)+''; // ALASKA.ai
#target Illustrator
/*
Working with the tags associated to selected art items
list, add, edit and remove objects tags
*/
main();
function main(){
@amolok
amolok / markes.js
Created November 23, 2012 05:40
AI: add coords labels to selected objects
/* add coords to marks */
var items = selection;
if (items.length>0) {
for (i=0; i<items.length; i++) {
var x = getX(items[i]);
var y = getY(items[i]);
// alert(i + ': x' + x + ' y' + y);
markPosition (items[i]);
@amolok
amolok / namedImageLayers.js
Created November 23, 2012 05:45
AI: name all placed images on selected layer with their filenames
/**********************************************************
Description: name all placed items (images)
in selected layer with their filenames
tested on Windows 7 Adobe Illustrator 5.0
**********************************************************/
if (app.documents.length>0) {
var d = app.activeDocument;
var l = d.activeLayer;
var r = l.placedItems;
@amolok
amolok / renumber.cmd
Created November 23, 2012 06:04
cmd: Windows 7 batch loop file renumber with leading zeroes
@echo off
echo renumber.cmd folder start total
echo ===============================
setlocal EnableDelayedExpansion
set /a start = %2
if NOT DEFINED [%3] (
for %%a in (.\%1\*.png) do ( set /a i+=1 )
echo Total files in folder %1: !i!
@amolok
amolok / split.cmd
Created November 23, 2012 06:50
cmd: Split files by folders
@echo off
echo split.cmd folder loop
echo -------------------------------
setlocal EnableDelayedExpansion
for %%a in (.\%1\*.png) do ( set /a i+=1 )
echo Total files in folder %1: !i!
set /a total = i
set /a folders = !total! / %2
echo Move *.png in folder %1 to subfolders [00..!folders!] by %2 files
@amolok
amolok / gist:7152925
Created October 25, 2013 10:59
MODx youtuBe links handler
<?php
/*
* [[!youtuBe?
* &tpl
* &links
* &outCls
* &rowCls
* &imgCls
* &linkPref
*/
@echo off
IF [%1]==[] (
echo renumbers.cmd filemask filename digits start digits start cycle
echo ~~~~~~~~~~~~~ bon_*.bmp bon 2 1 1 1 4
echo bon011.bmp bon012.bmp bon013.bmp bon014.bmp bon021.bmp bon022.bmp ...
echo ------------------------------------------------------------------------------------
) ELSE (
setlocal EnableDelayedExpansion
set prefix = %2