Skip to content

Instantly share code, notes, and snippets.

View sergey-miryanov's full-sized avatar
💭
Father of the little toddler, may be spontaneously unavailable

Sergey Miryanov sergey-miryanov

💭
Father of the little toddler, may be spontaneously unavailable
View GitHub Profile
@sergey-miryanov
sergey-miryanov / gist:5950067
Created July 8, 2013 15:56
generated c++ file
#include <hxcpp.h>
#ifndef INCLUDED_AnalyticsImpl
#include <AnalyticsImpl.h>
#endif
#ifndef INCLUDED_haxe_Log
#include <haxe/Log.h>
#endif
Void AnalyticsImpl_obj::__construct()
package ;
#if macro
import haxe.macro.Context;
import haxe.macro.Expr;
#end
/**
* ...
* @author deep <[email protected]>
*/
class Measure
@sergey-miryanov
sergey-miryanov / FinalWindow.hx
Created May 22, 2013 12:34
Example of movable group
package ;
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flixel.FlxGroup;
import org.flixel.FlxTypedGroup;
import Analytics;
class FinalWindow extends FlxGroup implements IGameDialog
@sergey-miryanov
sergey-miryanov / GameState
Created February 14, 2013 03:20
GameState with dialog, if dialog shown input from mouse and keyboard not handled by owner state.
package ;
import org.flixel.FlxState;
import org.flixel.FlxObject;
import org.flixel.FlxG;
class GameState extends FlxState
{
public var dialog : IGameDialog;
if (FlxG.mouse.justPressed ())
{
if (storeIcon.overlapsPoint (FlxG.mouse))
{
showStoreWindow ();
handled = true;
}
else if (finalIcon.overlapsPoint (FlxG.mouse))
{
showFinalWindow ();
@sergey-miryanov
sergey-miryanov / BitmapFont.hx
Last active December 11, 2015 07:18
BitmapFont support loading of oneline monospace bitmap fonts.
package ;
import org.flixel.FlxG;
import org.flixel.plugin.pxText.PxBitmapFont;
import nme.display.BitmapData;
import nme.geom.Rectangle;
class BitmapFont extends PxBitmapFont
{
private var glyphWidth:Int;
@sergey-miryanov
sergey-miryanov / gist:4426729
Created January 1, 2013 11:26
FlxSprite.fill doesn't work for cpp target
package;
import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flixel.FlxState;
import org.flixel.plugin.photonstorm.FlxDisplay;
class MenuState extends FlxState
{
@sergey-miryanov
sergey-miryanov / gist:4000695
Created November 2, 2012 12:05
profile decorator
from cProfile import Profile
from pstats import Stats
from os import environ
def profile (meth) :
if "ENABLE_PROFILE" not in environ :
return meth
profiler = Profile ()
@sergey-miryanov
sergey-miryanov / gist:3835052
Created October 4, 2012 17:15 — forked from jgranick/gist:1763850
NMML File Specification
<?xml version="1.0" encoding="utf-8"?>
<project>
<!-- <meta />
Use meta nodes to set metadata for your application. The description is ignored
on most targets, but is useful for packaging like Chrome Apps or Opera Widgets.
For compatibility with Android and webOS, the package name must include at least
@sergey-miryanov
sergey-miryanov / gist:3792403
Created September 27, 2012 05:48
getMaskForRow optimized
Было
89 function calls in 0.594 seconds
Ordered by: cumulative time, call count
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.005 0.005 0.594 0.594 MaskGenerator.py:19(getMaskForRow)
1 0.205 0.205 0.589 0.589 MaskGenerator.py:10(getMask)
1 0.014 0.014 0.384 0.384 MaskGenerator.py:29(__getRegionMask)
1 0.182 0.182 0.371 0.371 MaskGenerator.py:44(__getStatementRegionMask)