Skip to content

Instantly share code, notes, and snippets.

@bmc08gt
bmc08gt / DataStore.kt
Created August 12, 2020 16:13
Firebase Real-time Database value event listener via Kotlin callbackFlow{} updating Jetpack Compose list
fun locationsFlowable(): Flow<PantryResult<List<ItemLocation>>> {
return getLocationsChange()
}
@pratamawijaya
pratamawijaya / GoogleSignInBaseActivity.java
Created November 27, 2015 04:47
Extend this class to implement google sign-in. setSilentSignIn(false) to stop silent sign in http://bit.ly/1kVJAHZ. @OverRide handleGoogleSignInResult.
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
@treeherder
treeherder / bbb_rootfs.md
Last active July 1, 2023 21:36
how to expand the rootfs of the beagle bone black from a flashed eMMC onto the SD card

We have used the most recent beagleboard debian eMMC flasher image to flash the beagle bone black eMMC. As of this writing: wget http://debian.beagleboard.org/images/BBB-eMMC-flasher-debian-7.5-2014-05-14-2gb.img.xz After flashing is complete, erase the sd card, then reboot. Once booted, We can use fdisk -l to list our available devices, I found mine by checking the size and the partition table. After verfifying the card's address, we can reformat it to fit our needs. Of course, this can be done before plugging the card in, as well.

debian@beaglebone:~$ fdisk -l
Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192    31116287    15554048    b  W95 FAT32
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)