Skip to content

Instantly share code, notes, and snippets.

View naushad-madakiya's full-sized avatar
🎧
👨‍💻

Naushad naushad-madakiya

🎧
👨‍💻
View GitHub Profile
# format for commit message headline
# <type>(<scope>): <subject>
# <BLANK LINE>
# <body>
# <BLANK LINE>
# <footer>
# feature|fix|docs|style|refactor|perf|test|chore(app_name): subject
# Body
@naushad-madakiya
naushad-madakiya / shape.dart
Last active May 15, 2018 03:14
Intro to Dart for Java Developers: Create a factory
import 'dart:math';
abstract class Shape {
factory Shape(String type) {
if (type == 'circle') return new Circle(2);
if (type == 'square') return new Square(2);
throw "Can\'t create of type '$type'";
}
num get area;
@naushad-madakiya
naushad-madakiya / rectangle.dart
Created May 15, 2018 02:37
Intro to Dart for Java Developers: Use optional parameters (instead of overloading)
import 'dart:math';
class Rectangle {
int width;
int height;
Point origin;
// initialize construction with optional/default value
Rectangle({this.origin = const Point(0, 0), this.width = 0, this.height = 0});
@naushad-madakiya
naushad-madakiya / bicycle.dart
Last active May 15, 2018 02:31
Intro to Dart for Java Developers Codelab: Simple Dart Class
class Bicycle {
int cadence;
int _speed = 0;
int gear;
Bicycle(this.cadence, this.gear);
int get speed => _speed;
void applyBrake(int decrement) => _speed -= decrement;
@naushad-madakiya
naushad-madakiya / CoinHive.java
Created January 14, 2018 07:03
Coinhive miner found in androidapk.world
package com.coinhiveminer;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.WindowManager.LayoutParams;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class CoinHive {
@naushad-madakiya
naushad-madakiya / README-Template.md
Created February 10, 2017 18:39 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@naushad-madakiya
naushad-madakiya / ParallaxPageTransformer.java
Created September 27, 2016 14:40 — forked from Aracem/ParallaxPageTransformer.java
Parallax transformer for ViewPagers that let you set different parallax effects for each view in your Fragments.
package com.aracem.utils.animations.pagetransformation;
import org.jetbrains.annotations.NotNull;
import android.support.v4.view.ViewPager;
import android.view.View;
import java.util.ArrayList;
import java.util.List;