Skip to content

Instantly share code, notes, and snippets.

@illuzor
illuzor / .gitlab-ci.yml
Last active April 25, 2024 05:22
Config for gitlab ci android with unit tests and instrumented tests
image: ubuntu:22.04
variables:
ANDROID_COMPILE_SDK: "33"
ANDROID_BUILD_TOOLS: "33.0.2"
EMULATOR_IMAGE: "24"
SDK_TOOLS: "9477386" # from https://developer.android.com/studio/#command-tools
before_script:
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
* Copy from https://blog.csdn.net/fjh658/article/details/12869073
*/
public class AmrLength {
public synchronized static long getAmrDuration(File file) throws IOException {
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="define_int_commonsio" translatable="false" />
<string name="library_commonsio_author" translatable="false">The Apache Software Foundation</string>
<string name="library_commonsio_authorWebsite" translatable="false">http://apache.org</string>
<string name="library_commonsio_libraryName" translatable="false">Apache Commons IO</string>
<string name="library_commonsio_libraryDescription" translatable="false">Commons IO is a library of utilities to assist with developing IO functionality.</string>
<string name="library_commonsio_libraryWebsite" translatable="false">http://commons.apache.org/proper/commons-io/</string>
<string name="library_commonsio_libraryVersion" translatable="false">2.6</string>
<string name="library_commonsio_isOpenSource" translatable="false">true</string>
@illuzor
illuzor / graphics.coverter.xml
Last active February 22, 2016 11:28
graphics.coverter.xml
<project name="Graphics Converter" default="atlasses.and.gafs" basedir="..">
<!--путь к air sdk-->
<property name="flex.home" location="C:/Program Files (x86)/FlexSDK/AIR SDK" />
<!--путь к pvr2atf-->
<property name="atf.tool" location="${flex.home}/atftools/pvr2atf.exe" />
<!--путь к PVRTexToolCLI-->
<property name="pvr.tool" location="C:/Program Files/PowerVR/Tool/PVRTexTool/CLI/Windows_x86_32/PVRTexToolCLI.exe" />
<!--путь к атласам в формате pvr-->
package {
import flash.display.Bitmap;
import starling.display.Shape;
import starling.display.Sprite;
import starling.events.Event;
import starling.textures.Texture;
public class GraphicsTest extends Sprite {
var backTexture:SubTexture = atlas.getTexture("menuBackground") as SubTexture;
var clipping:Rectangle = backTexture.clipping;
var uvMatrix:Matrix = new Matrix();
uvMatrix.scale(stage.stageWidth / (backTexture.width * clipping.width), stage.stageHeight / (backTexture.height * clipping.height));
var background:Shape = new Shape();
addChild(background);
background.graphics.beginTextureFill(backTexture, uvMatrix);
background.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
background.graphics.endFill();
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Rectangle;
import starling.core.Starling;
public class Main extends Sprite {
public function Main():void {
private var myText:TextField; // move the var to class-level
// if you create var inside function it not be visible in another function
private function init(e:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
trace('stage has been found')
stage.addEventListener(KeyboardEvent.KEY_DOWN, EnterStart);
myText = new TextField();
myText.text = "Republic of Code";
addChild(myText);
<target name="copy.files" description="Files operations">
<unzip src="temp/libs/notifExtLib.swc" dest="temp/libs/"/>
<copy file="extension.xml" tofile="temp/ane/extension.xml"/>
<copy file="temp/libs/library.swf" tofile="temp/ane/android/library.swf"/>
<move file="temp/libs/library.swf" tofile="temp/ane/default/library.swf"/>
<move file="temp/libs/notifExtLib.swc" tofile="temp/ane/notifExtLib.swc"/>
</target>
<target name="compile.swc" description="Making swc lib">
<compc
failonerror="true"
use-network="false"
debug="false"
swf-version="22"
output="temp/libs/notifExtLib.swc">
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />
<include-sources dir="${as.classes}">
<include name="**/*.as*" />