Skip to content

Instantly share code, notes, and snippets.

@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@rharter
rharter / InjectableActivityTestRule.kt
Last active December 6, 2021 12:07
Test Rule that allows you to use Dagger Android's automatic lifecycle based injection without making your Application class `open`, or overriding it in tests.
package com.pixite.pigment.testing
import android.app.Activity
import android.app.Application
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
@danybony
danybony / screenshot_android.sh
Last active June 30, 2021 12:05
Android screenshot to current dir
#!/bin/bash
while getopts y: flag
do
case "${flag}" in
y) size=${OPTARG};;
esac
done
DEVICES=`adb devices | grep -v devices | grep device | cut -f 1`
@tasomaniac
tasomaniac / screenrecord.sh
Last active June 28, 2022 22:05 — forked from PaulKinlan/getdeviceart.sh
Screen Record for Android
#!/bin/sh
set -e
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
@bkase
bkase / prnsaaspfruicc.md
Created March 3, 2016 22:58
Production-Ready(?) Native Single-Atom-State Purely Functional Reactive Composable UI Components, or PRNSAASPFRUICC

Production-Ready(?) Native Single-Atom-State Purely Functional Reactive Composable UI Components, or PRNSAASPFRUICC

The native UI toolkits on Android and iOS are frustratingly imperative. Unfortunately, there has been little architecture evolution (unlike the web). However, nothing(ish) is stopping us from bolting something "nice" on top. By nice I mean single-atom-state purely functional reactive composable UI components. In this post, I'll explain what this title means, the inspiration behind the design of the framework, an example component, and dive a little into the framework's implementation.

Right now, there only exists a Kotlin (Android) implementation, but a Swift port will be relatively straightforward and will happen soon.

Let's break down the title:

  • "Production-Ready"
@serj-lotutovici
serj-lotutovici / Oauth1SigningInterceptor.java
Last active March 1, 2024 15:46 — forked from JakeWharton/Oauth1SigningInterceptor.java
An OkHttp interceptor which does OAuth1 signing. Requires Java 7 (but can easily be ported to Java 6).
/*
* Copyright (C) 2015 Jake Wharton
*
* 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
@rock3r
rock3r / giffify.py
Last active January 14, 2022 09:00
Giffify - easily create optimised GIFs from a video
#!/usr/bin/python
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
import argparse, sys, subprocess, tempfile
@vgonda
vgonda / MainActivityTest.java
Created June 11, 2015 13:51
Example of how to use espresso-intents in Android tests
package com.collectiveidea.example;
import android.content.Intent;
import android.support.test.espresso.intent.Intents;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.collectiveidea.example.ui.LoginActivity;
import com.collectiveidea.example.ui.MainActivity;
import com.collectiveidea.example.util.AccountUtility;
@patrickhammond
patrickhammond / EspressoTestRule.java
Last active September 2, 2018 12:14
Hacking through Espresso issues...
import android.app.Activity;
import android.app.Instrumentation;
import android.app.KeyguardManager;
import android.app.KeyguardManager.KeyguardLock;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.support.test.InstrumentationRegistry;
@JakeWharton
JakeWharton / README.md
Last active April 17, 2023 14:07
A JUnit @rule which launches an activity when your test starts. Stop extending gross ActivityInstrumentationBarfCase2!