Skip to content

Instantly share code, notes, and snippets.

View arturogutierrez's full-sized avatar
💻
Coding

Arturo Gutiérrez arturogutierrez

💻
Coding
View GitHub Profile
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.index, this.title, this.icon, this.color);
final int index;
final String title;
final IconData icon;
final MaterialColor color;
}
@mkobit
mkobit / build.gradle.kts
Last active December 14, 2022 00:29
Run Kotlin REPL with built source code and main classpath in Gradle
// Assuming Kotlin plugin is applied...
// Run as: ./gradlew kotlinRepl --console plain --no-daemon
val kotlinRepl by tasks.creating {
description = "Starts Kotlin REPL with compiled main classes and runtime classpath"
val mainSourceSet = java.sourceSets["main"]
dependsOn(mainSourceSet.output)
doFirst {
val buildscriptClasspath = rootProject.buildscript.configurations["classpath"]
@Saissaken
Saissaken / Update git fork with tags.sh
Last active April 20, 2024 18:10
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@alorma
alorma / VectorMenuIconHolder.java
Created February 8, 2017 17:13
VectorMenuIconHolder
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.v4.graphics.drawable.DrawableCompat;
@ascendbruce
ascendbruce / README.md
Last active May 8, 2024 17:50
Use macOS-style shortcuts in Windows

Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

ℹ️ There is a newer alternative project that does similar things and more, check it out at https://github.com/stevenilsen123/mac-keyboard-behavior-in-windows

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

How does it work

@alxsimo
alxsimo / RxFirebaseRemoteConfig.java
Last active December 15, 2016 16:42
[Rx] RxFirebaseRemoteConfig
package com.milanuncios.milanunciosandroid.common.remoteconfig;
import com.alexsimo.toolbelt.optional.Optional;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
import com.milanuncios.milanunciosandroid.BuildConfig;
import java.util.Map;
import rx.AsyncEmitter;
import rx.Observable;
@TinasheMzondiwa
TinasheMzondiwa / RxFirebase.java
Created October 14, 2016 09:56
RxFirebase implementation. Fork from https://gist.github.com/gsoltis/86210e3259dcc6998801 with my improvements.
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import rx.Observable;
import rx.Subscriber;
@pakoito
pakoito / ADomainDrivenApproachToKotlinsNewTtypes.kt
Last active January 11, 2021 19:20
Final code example for "A domain driven approach to Kotlin's new types"
data class UserInfo(val id: String)
data class UserInfoDto(var id: String?)
// Open Inheritance
interface IViewState { }
class Idle: IViewState

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@pedrovgs
pedrovgs / MVP_discussion.md
Last active August 2, 2023 16:53
Interfaces for presenters in MVP are a waste of time!

##Interfaces for presenters in MVP are a waste of time!

It's been a long time since we started talking about MVP. Today, the discussion is about if creating an interface for the Presenter in MVP is needed.

This is the Model View Presenter pattern's schema:

MVP Schema

In this schema the Model box is related to all the code needed to implement your business logic, the presenter is the class implementing the presentation logic and the view is an interface created to abstract the view implementation.