Skip to content

Instantly share code, notes, and snippets.

@rharter
rharter / Scoped.kt
Last active August 12, 2024 09:48
A kotlin property delegate to scope any object to an android lifecycle. Blog post at https://ryanharter.com/blog/easy-android-scopes/
import androidx.lifecycle.get
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner
/**
* Returns a property delegate to access the wrapped value, which will be retained for the
* duration of the lifecycle of this [ViewModelStoreOwner].
*
@aahlenst
aahlenst / RxIdlingResource.java
Last active July 27, 2021 15:56
IdlingResource that makes Espresso 2 wait until all RxJava 2 tasks have finished
/*
* The MIT License
*
* Copyright (c) 2016 Andreas Ahlenstorf
*
* 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
@lisawray
lisawray / MainActivity.java
Last active March 26, 2023 11:57
Vector drawables from XML with the Android support library 23.3.0
package com.xwray.vectorbinding;
import android.databinding.BindingAdapter;
import android.databinding.DataBindingUtil;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
@ferdy182
ferdy182 / CircularRevealingFragment.java
Created March 27, 2015 17:18
Make circular reveal animations on a fragment
/**
* Our demo fragment
*/
public static class CircularRevealingFragment extends Fragment {
OnFragmentTouched listener;
public CircularRevealingFragment() {
}
@rpattabi
rpattabi / 7in7_Io.markdown
Last active August 29, 2015 14:07
Seven Languages in Seven Weeks - Io Language

Io Language

Day 2 Self-Study

1 Fibonacci

fib := method(n,
  if(n==0, 0,
     if(n==1, 1,
        fib(n-1)+fib(n-2)))
@jezen
jezen / Io Example Problems
Created December 15, 2013 13:17
The example problems have gone missing from the Io language website, so here’s a backup.
#Sample code
#Hello world
"Hello world!" print
#Factorial
factorial := method(n, if(n == 1, 1, n * factorial(n - 1)))
99 bottles of beer
@ananthp
ananthp / stuff_on_top_of_ubuntu.markdown
Last active August 29, 2018 17:17 — forked from rpattabi/stuff_on_top_of_ubuntu.md
Stuff On Top of Ubuntu

Stuff to install or setup on top of default ubuntu installation

Launcher Shortcuts

Remove libre office. Add ..

  • Update Manager
  • System Monitor
  • Terminal
@thulio
thulio / gcccpuopt.sh
Created July 24, 2012 12:21
Get GCC optimal compile flags
#!/bin/sh
# Print the gcc cpu specific options tailored for the current CPU
# Author:
# http://www.pixelbeat.org/
# Notes:
# This script currently supports Linux,FreeBSD,Cygwin
# This script is x86 (32 bit) specific
# It should work on any gcc >= 2.95 at least
@rpattabi
rpattabi / study_notes_vim.md
Created April 21, 2012 03:05
"Learning vi and vim editors" - study notes

Study Notes for "Learning vi and vim editors" (7th edition)
I want to take notes for only the new things I was not aware of

Vim Practice:
I am editing this using gVim through Firefox's ItsAllText! extension.


the vi text editor

@ananthp
ananthp / gist:1195378
Created September 5, 2011 16:21
Music college facebook page -- description info etc

** Backup. Old text. ** Before modified by Ananth


About

music:The Universal language of Mankind,the one incorporeal entrance into the higher world of knowledge which comprehends mankind but which mankind cannot comprehend.