Skip to content

Instantly share code, notes, and snippets.

View roipeker's full-sized avatar
🏠
Working from home

Roi Peker roipeker

🏠
Working from home
View GitHub Profile
@roipeker
roipeker / DrawMovieClip.as
Created January 16, 2018 20:18
Draws a Flash MovieClip to make a Starling texture considering the texture scale.
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on Jan 16 2019.
//
// =================================================================================================
/*
== Sample screenshots ==
@roipeker
roipeker / BezierEase.as
Created April 21, 2018 13:40
Cubic Bezier Easing for any AS3 Tween engine (Starling / Greensock)
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 21/04/2018.
//
// =================================================================================================
// ** Cubic Bezier Easing **
// based on https://github.com/gre/bezier-easing/
//
// Compatible with Greensock and Starling tween engine.
@roipeker
roipeker / MeshRoundRect.as
Last active December 10, 2018 21:22
Starling's Mesh object to display rounded rectangles (similar to ::graphics.drawRoundRect())
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 23/04/2018.
//
// =================================================================================================
/**
*
* Remember to set a good value for antialiasing: starling.antiAliasing = 8;
*
@roipeker
roipeker / Elevations.as
Last active April 26, 2018 09:45
Google Material Shadows for Starling.
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 26/04/2018.
//
// =================================================================================================
package roipeker.display.material {
// Values (in dp) based on:
// https://material.io/guidelines/material-design/elevation-shadows.html
@roipeker
roipeker / BezierPath.as
Created April 26, 2018 20:57
Cubic BezierPath for Starling compatible with Greensock and Starling's Tween engines.
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 26/04/2018.
//
// =================================================================================================
/**
*
* Cubic bezier path compatible with Tween engines (x/y/rotation), specially designed to use in Starling Tween
@roipeker
roipeker / AnimatedTabBar.as
Created November 7, 2018 01:23
Custom TabBar for Feathers
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 06/11/2018.
//
// =================================================================================================
package {
import feathers.controls.TabBar;
import feathers.controls.ToggleButton;
@roipeker
roipeker / AnimatedTabBar.as
Last active November 7, 2018 02:30
Custom TabBar for Feathers
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 06/11/2018.
//
// =================================================================================================
package {
import feathers.controls.TabBar;
import feathers.controls.ToggleButton;
@roipeker
roipeker / FeathersUtils.as
Created November 7, 2018 16:07
FeathersUtils.
// =================================================================================================
//
// Created by Rodrigo Lopez [roipeker™] on 07/11/2018.
//
// =================================================================================================
package com.roipeker.feathers {
import feathers.core.FeathersControl;
import flash.utils.Dictionary;
@roipeker
roipeker / DescribeTypeJSON.as
Created January 20, 2019 19:50
describeTypeJSON (faster and easier).
// =================================================================================================
//
// Modified by Rodrigo Lopez [roipeker™] on 20/01/2019.
//
// original class:
// https://github.com/tschneidereit/SwiftSuspenders/blob/master/src/avmplus/DescribeTypeJSON.as
//
// Check https://jacksondunstan.com/articles/2609 for reference.
//
//
@roipeker
roipeker / main.dart
Created June 6, 2019 03:10
Sumas de duraciones en Dart
void main() {
List<Duration> duraciones = List<Duration>();
duraciones.add(Duration(hours: 1, minutes: 10));
duraciones.add(Duration(minutes: 30));
duraciones.add(Duration(minutes: 48, seconds: 30));
duraciones.add(Duration(hours: 2, minutes: 20));
Duration resultado = duraciones.reduce((d1, d2) => d1 + d2);
print("${resultado}");