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 / 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 / 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 / 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 / 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}");
@roipeker
roipeker / main.dart
Created June 7, 2019 16:31
Flutter - [referencia] lista de cards horizontal con multiples opciones cada una.
import 'package:flutter/material.dart';
class CardOptionItem {
final String title;
bool selected;
CardOptionItem({this.title, this.selected: false});
}
class CardModel {
String title;
@roipeker
roipeker / flutter.md
Created June 7, 2019 18:26 — forked from matteocrippa/flutter.md
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like: