Skip to content

Instantly share code, notes, and snippets.

View Store.tsx
import RecordData from "../data/RecordData";
import { observable, computed, action } from "mobx";
import DataLoader from "../services/DataLoader";
import TableData from './TableData';
export default class Store {
@observable records: RecordData[] = [];
@observable searchString: string = "";
@observable tableData:TableData = new TableData();
View RecordsTable.tsx
import React, { KeyboardEvent, Component } from "react";
import {
makeStyles,
withStyles,
Theme,
createStyles
} from "@material-ui/core/styles";
import Table from "@material-ui/core/Table";
import TableHead from "@material-ui/core/TableHead";
import TableBody from "@material-ui/core/TableBody";
@k0t0vich
k0t0vich / Main.hx
Created Aug 1, 2019
Typed event listeners example In the beginning of this article we also mentioned the addEventListener function, so for the sake of completeness, let's also apply our new knowledge to it. Here, we use type parameter to specify listener function type:
View Main.hx
import haxe.Constraints.Function;
abstract Event<T:Function>(String) {
public inline function new(name) {
this = name;
}
}
extern class EventEmitter {
function new();
View ResourceManager.as
if ( asset ) { // если ассет, то помучаемся
DeleteUtils.remove(asset._managers, this );
for each ( var has:Boolean in asset._managers ) break;
// вот что здесь должно быть? первое значение? любое значение?
if ( !has ) {
DeleteUtils.remove(_HASH, bundleName );
View Permission.as
private function checkPermissions():void {
if (File.permissionStatus != PermissionStatus.GRANTED){
var dir:File = File.documentsDirectory.resolvePath("air.ru.mail.games.riotzone");
//dir.addEventListener(PermissionEvent.PERMISSION_STATUS, permissionStatusHandler);
_interval = setInterval(checkPermissionAnswer, 1000);
dir.requestPermission();
} else {
initApp();
}
}
View FilePermission.as
private function checkPermissions():void {
if (File.permissionStatus != PermissionStatus.GRANTED){
var dir:File = File.documentsDirectory.resolvePath("air.ru.myGame");
dir.addEventListener(PermissionEvent.PERMISSION_STATUS, permissionStatusHandler);
dir.requestPermission();
} else {
initApp();
}
}
@k0t0vich
k0t0vich / MobileAndroid-app.template.xml
Last active May 13, 2016
air android ant make apk for armv7 and x86
View MobileAndroid-app.template.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/[airVersionPattern]">
<filename>[fileNamePattern]</filename>
<id>[packagePattern]</id>
<name>[namePattern]</name>
<versionNumber>[versionNumberPattern]</versionNumber>
<versionLabel>[versionLabelPattern]</versionLabel>
<initialWindow>
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
View .as
private function writeNextFile():void {
Tracer.add("DownloadTarResourcesCommand.writeNextFile:",_filesToWriteCount, _filesToWrite.length, MAX_FILES_TO_WRITE, _totalFilesToWriteCount);
var tarFile:TarFile;
if (_filesToWriteCount <= MAX_FILES_TO_WRITE && _filesToWrite.length > 0){
tarFile = _filesToWrite.pop();
_filesToWriteCount++;
var path: String = _context.hash[tarFile.name].md5Name;
View gist:d7cc64d372fe760525e2
new EazeTween(_fg)
.to(0.2e3, { alpha: 1 })
.onComplete(function():void {
updateValue();
if ( _fg ) {
new EazeTween(_fg).to(0.5e3, { alpha: 0 } );
}
});
// эквивалент ли?
View README_integration_with_Adobe_FlashBuilder.txt
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0