Skip to content

Instantly share code, notes, and snippets.

View amalChandran's full-sized avatar
💭
I may be slow to respond.

Amal Chandran amalChandran

💭
I may be slow to respond.
View GitHub Profile
@cferdinandi
cferdinandi / recruiter.md
Created August 2, 2019 16:24
Was I too harsh here?

Recruiter Email:

We have reached out to you in the past and wanted to make sure you didn't miss this opportunity with [REDACTED]. We take pride in building a strong culture and making work a place you love to be every day, especially since we spend so much of our lives doing it!

At [REDACTED] we are committed to providing you with a job you love doing everyday and take pride in making sure you are home for dinner. We ask that you come on-site 2 days a week and you can work remotely the rest of the time. However, you might want to come in anyways! Every new team member gets a $500 slush fund towards enhancing the office/workspace (we have 3D printers!), game nights, and team trips. For example, the team is heading to Amsterdam this year!

I would love to tell you more about what we can offer you. When do you have 10-15 minutes to talk?

My Response:

@antonyharfield
antonyharfield / RailwayOP-CompleteExample.kt
Created April 29, 2019 17:51
Railway Oriented Programming in Kotlin (as described here)
// Result is a superpowered enum that can be Success or Failure
// and the basis for a railway junction
sealed class Result<T>
data class Success<T>(val value: T): Result<T>()
data class Failure<T>(val errorMessage: String): Result<T>()
// Composition: apply a function f to Success results
infix fun <T,U> Result<T>.then(f: (T) -> Result<U>) =
when (this) {
is Success -> f(this.value)
@brescia123
brescia123 / ViewVisibilityExtensions.kt
Last active May 10, 2023 12:28
Useful Android Kotlin Extension functions to easily change the visibility of a View
/** Set the View visibility to VISIBLE and eventually animate the View alpha till 100% */
fun View.visible(animate: Boolean = true) {
if (animate) {
animate().alpha(1f).setDuration(300).setListener(object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator) {
super.onAnimationStart(animation)
visibility = View.VISIBLE
}
})
} else {
@devunwired
devunwired / FlickerActivity.java
Created December 22, 2016 22:27
Quick Android Things demo using ObjectAnimator to animate the brightness of a PWM output. This example uses a BounceInterpolator to create a flickering effect on an LED (like a candle).
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@bryanstern
bryanstern / OkHttpStack.java
Last active April 24, 2022 03:17
An OkHttp backed HttpStack for Volley
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@tir38
tir38 / gist:3d03f5b94c30595fdeeb
Last active December 25, 2015 06:13
Extends Daniel Olshansky's DevByte example "ListView Expanding Cells Animation" to allow for custom collapsable height http://www.youtube.com/watch?v=mwE61B56pVQ http://developer.android.com/shareables/devbytes/ListViewExpandingCells.zip

In Daniel's example, all rows contain the same view, so their collapsed heights are all the same. However if you have different size collapsed rows, the animation will be jumpy. To fix this

  1. pull the cell height out of the constructor for ExpandableListItem:
public class ExpandableListItem implements OnSizeChangedListener {

    private String mTitle;
    private String mText;
 private boolean mIsExpanded;
@ec84b4
ec84b4 / gist:d56c00fb5fd2dfaf279b
Last active June 26, 2018 06:22
recycler view header adapter
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* Created by khaled bakhtiari on 10/26/2014.
* <a href="http://about.me/kh.bakhtiari">
*/
@staltz
staltz / introrx.md
Last active May 18, 2024 05:17
The introduction to Reactive Programming you've been missing