Skip to content

Instantly share code, notes, and snippets.

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

Hugo Matilla HugoMatilla

🏠
Working from home
View GitHub Profile
@HugoMatilla
HugoMatilla / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@HugoMatilla
HugoMatilla / ADBCheatSheet.md
Last active January 4, 2024 11:22
ADB Cheat Sheet

CONFIG

Include adb and other android tools on your path

In Users/hugomatilla.bash_profile add export PATH=$PATH:/Users/hugomatilla/Documents/AndroidSDKs/sdk/platform-tools export PATH=$PATH:/Users/hugomatilla/Documents/AndroidSDKs/sdk/tools

My own adb location

cd /Users/hugomatilla/Documents/AndroidSDKs/sdk/platform-tools
@HugoMatilla
HugoMatilla / Android Lollipop Widget Tinting Guide
Created April 5, 2016 10:26 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
class AppRestService : IAppRestService {
override fun getAppRestService(): IRestService {
val httpClient = OkHttpClient().newBuilder()
val interceptor = Interceptor { chain ->
val request = chain?.request()?.newBuilder()?.addHeader("SomeHeader", "SomeHeaderProperty")?.build();
chain?.proceed(request)
}
httpClient.networkInterceptors().add(interceptor)
val customGson = GsonBuilder().registerTypeAdapter(MyClassCloud::class.java, MyClassCloudDeserializer("1")).create()
val retrofit = Retrofit.Builder().baseUrl(IRestService.URL_BASE).addConverterFactory(GsonConverterFactory.create(customGson)).client(httpClient.build()).build()
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.min.js";
document.head.appendChild(script);
@HugoMatilla
HugoMatilla / index.html
Created December 12, 2016 14:32 — forked from anonymous/index.html
JS Bin flat dates // source https://jsbin.com/vomave
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="flat dates">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.2/moment.min.js"></script>
@HugoMatilla
HugoMatilla / Gradle Cheat Sheet.md
Last active February 23, 2021 07:36
Gradle Cheat Sheet

DEPENDENCIES TREE

./gradlew app:dependencies

With only first item

./gradlew <module-name>:dependencies | grep '\-\-\-' | grep -Po '\w+.*$' | awk -F ' ' '{ print $1 }' | sort | grep -v '\{' | grep -v '\[' | uniq | grep '.\+:.\+:.\+'

RUN TESTS

./gradlew test

class Button {
fun click() = print("Click")
}
class SpecificButton : Button() { // Error
override fun click() = print("Specific Click") // Error
}
open class Button {
open fun click() = print("Click")
fun doubleClick() = print("Double Click")
}
class SpecificButton() : Button { // Inheritance is now possible
override fun click() = print("Specific Click") // Now it works
override fun doubleClick() = print("Specific Double Click") // Error
}
class SuperSpecificButton : SpecificButton {
final override fun click() = print("Super Specific Click")
}