Skip to content

Instantly share code, notes, and snippets.

@tyhawkins
tyhawkins / zoom-mute-status.scpt
Last active May 27, 2022 20:51
Get Zoom Mute/Unmute Status
property btnTitle : "Mute audio"
if application "zoom.us" is running then
tell application "System Events"
tell application process "zoom.us"
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
set returnValue to "Unmuted"
else
set returnValue to "Muted"
end if
package com.squareup.leakcanary
import android.app.Application
import com.bugsnag.android.Client
import com.bugsnag.android.MetaData
import com.bugsnag.android.Severity.ERROR
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.FAILURE
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.LEAK
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.NOT_FOUND
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.WONT_FIX_LEAK
@alexjlockwood
alexjlockwood / CircleSquareView.kt
Created April 8, 2019 05:59
Inspired by @beesandbombs (twitter.com/beesandbombs)
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
import kotlin.math.cos
import kotlin.math.sin
import kotlin.math.sqrt
@brianegan
brianegan / spinnies2.dart
Created January 21, 2019 17:43
Shows how to create some funky spinners
import 'dart:math' show pi;
import 'package:flutter/material.dart';
/// A Widget that can be configured to show funky spinning rectangles!
///
/// ### Usage
///
/// ```
/// Spinnies(
@dlew
dlew / script.sh
Created November 9, 2018 16:36
Simple AndroidX Migration Script
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.
@lyshie
lyshie / BackupAndroid.md
Last active November 16, 2021 20:32
Backup Android device via SSHelper and rsync
  • Install SSHelper or 08.30.2018 Version 11.9
  • mount Android device via sshfs
    $ printf "admin\n" | sshfs [email protected]:/ ~/mnt -o port=2222,password_stdin
    
  • use rsync to backup all files
    $ rsync -avH --progress ~/mnt/storage/extSdCard/DCIM .
    
  • passwordless login
@BrantApps
BrantApps / oceanlife-activity-fragment.graphml
Last active February 27, 2018 18:08
Degraph configuration file used within BrantApps/OceanLife to isolate and visualise package tangle. See http://blog.schauderhaft.de/degraph/ & https://github.com/schauder/degraph
output = oceanlife-activity-fragment.graphml
classpath = ../../../OceanLife/app/build/intermediates/classes/withAmazon/debug/com/brantapps/oceanlife/
# Don’t model dependencies
exclude = java*.**
exclude = android*.**
exclude = dagger*.**
exclude = rx*.**
exclude = okhttp*.**
exclude = org*.**
#!/usr/bin/swift
// Run: $ swift noCrashplan.swift
// Background: https://github.com/KrauseFx/overkill/issues/3#issuecomment-270505227
import Foundation
import Cocoa
import ServiceManagement
let badApps = [ "Code42 CrashPlan", "CrashPlanService", "CrashPlanLauncher", "CrashPlanWeb" ]
final PublishRelay<String> refreshRelay = PublishRelay.create()
void refreshData() {
refreshRelay.call("refresh event")
}
Observable<Lce<Data>> getDataEventStream() {
return refreshRelay
.startWith("initial")
.switchMap { event ->
public void onAttach(View view) {
// Remember to clean the subscription!
repository.getDataEventStream().subscribe({ event ->
if (event.isLoading) {
view.showLoading(true)
} else if (event.hasError()) {
view.showError(event.getError())
} else {
view.showData(event.getData())
}