Skip to content

Instantly share code, notes, and snippets.

@k0t0vich
k0t0vich / Tracer.as
Last active August 29, 2015 14:01
Tracer.as
public static function addStack():void {
if (!_inited) return;
try {
throw new Error("getStack");
} catch (e:Error){
trace (e.getStackTrace());
}
}
@k0t0vich
k0t0vich / gist:67c762bf9bca2d2df7f5
Created June 4, 2014 06:38
without super/this etc
package components {
/**
*
* @author Dimarik
* @version 1.0
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
*
@k0t0vich
k0t0vich / gist:0bd80081116313fbc586
Created June 4, 2014 06:39
with super/this etc
package components
{
/**
*
* @author Dimarik
* @version 1.0
* @langversion 3.0
* @playerversion Flash 10
* @playerversion AIR 1.5
package ru.riot.utils.net.tar {
import flash.display.Shape;
import flash.events.Event;
import flash.utils.IDataInput;
[Event(name="fileParsed", type="ru.riot.utils.net.tar.TarParserEvent")]
[Event(name="archiveParsed", type="ru.riot.utils.net.tar.TarParserEvent")]
public class StreamTarParser extends TarParser {
private static const BLOCK_SIZE: int = 512;
private static const frameListener:Shape = new Shape();
@k0t0vich
k0t0vich / gist:763c4b1f997f603d0c5d
Created September 12, 2014 09:08
Social auth for StageWebView
// FB
ClassPrototype.login = function(callback, error) {
if(_mod == "mobile") {
var url = "https://www.facebook.com/dialog/oauth?client_id=" + CONFIG.desktop.fb.id +
"&redirect_uri=" + window.location.protocol + "//" + window.location.hostname + "/checkfb.html" +
"&scope=email" +
"&response_type=token"+
"&display=popup";
location.href = url;
} else {
http://vk.com/share.php?url=http://riot.mail.ru/new_level.html&title=%D0%A3%20%D0%BC%D0%B5%D0%BD%D1%8F%20%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9%20%D1%83%D1%80%D0%BE%D0%B2%D0%B5%D0%BD%D1%8C!%20%D0%90%D0%B9%D0%B4%D0%B0%20%D0%B2%D0%BE%D0%B5%D0%B2%D0%B0%D1%82%D1%8C!&description=%D0%AF%20%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D0%BB%20%D0%BD%D0%BE%D0%B2%D1%8B%D0%B9%20%D1%83%D1%80%D0%BE%D0%B2%D0%B5%D0%BD%D1%8C%20%D0%B2%20RiotZone!%20%D0%9F%D1%80%D0%B8%D1%81%D0%BE%D0%B5%D0%B4%D0%B8%D0%BD%D1%8F%D0%B9%D1%81%D1%8F%20%D0%BA%D0%BE%20%D0%BC%D0%BD%D0%B5,%20%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%88%D0%B8%20%D0%BA%D0%BE%D0%BD%D1%82%D1%80%D0%B0%D0%BA%D1%82%20%D0%BD%D0%B0%D0%B5%D0%BC%D0%BD%D0%B8%D0%BA%D0%B0!%20%D0%A2%D0%B5%D0%B1%D1%8F%20%D0%B6%D0%B4%D1%83%D1%82%20%D0%B6%D0%B0%D1%80%D0%BA%D0%B8%D0%B5%20%D0%B1%D0%BE%D0%B8%20%D0%B8%20%D0%BD%D0%B5%D1%81%D0%BC%D0%B5%D1%82%D0%BD%D1%8B%D0%B5%20%D0%B1%D0%BE%D0%B3%D0%B0%D1%82%D1%81%D1%82%D0%B2%D0%B0!&image=http://riot.mail.ru/black/image2/logo.jpg&noparse=true&r=794
http://www.odnoklassniki.ru/dk?st.
function invoke(func) {
riot.common.loadJS(window.location.protocol + _apiURL, function() {
if (_initialize < 2) {
_queue.push(func);
if (_initialize < 1) {
_initialize = 1;
var interval;
var f = function () {
if ( typeof(mailru) ) {
clearInterval(interval);
package ru.yandex.maps.pano.engine.math.utils {
import ru.yandex.maps.geo.GeoPoint;
import ru.yandex.maps.pano.engine.core.SphericalCoordinates;
public class CoordinatesUtil {
public static function sphericalFromGeoPoints(centralPoint:GeoPoint,
geoPoint:GeoPoint):SphericalCoordinates {
var distance:Number = centralPoint.distanceTo(geoPoint);
var azimuth:Number = centralPoint.azimuthTo(geoPoint);
package arp.utils {
import flash.display.BitmapData;
import flash.display.DisplayObject;
import flash.geom.Matrix;
import flash.geom.Rectangle;
public function getVisibleBounds(source:DisplayObject, padding:int = 0):Rectangle {
var matrix:Matrix = new Matrix()
matrix.tx = -source.getBounds(null).x + padding;
matrix.ty = -source.getBounds(null).y + padding;
////////////////////////////////////////////////////////////////////////////////
//
// © 2007 BlooDHounD
//
////////////////////////////////////////////////////////////////////////////////
package by.blooddy.abc.swf {
import flash.utils.ByteArray;
/**