Skip to content

Instantly share code, notes, and snippets.

View louis993546's full-sized avatar
😂

Louis Tsai louis993546

😂
View GitHub Profile
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 22, 2024 22:01
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@mikepenz
mikepenz / android-adb-usb-speed.sh
Created November 12, 2019 11:28
Quick helper script to detect the speed of the USB connection of connected Android devices
#!/bin/bash
# some helper vars
# https://unix.stackexchange.com/a/10065/138249
if test -t 1; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold=$(tput bold)
normal=$(tput sgr0)
success=$(tput setaf 2)
@greenrobot
greenrobot / removeAllMultiTx.java
Created March 26, 2018 15:23
A "rescue" version of Box.removeAll() for DBs that reached their size limit.
/**
* A "rescue" version of Box.removeAll() for DBs that reached their size limit.
* Removes data in multiple transactions of increasing size to minimize required additional disk space.
* <p>
* Note that this method is not transactional, so it might fail in between, with any number of objects removed.
* Thus, you should persistently track the state yourself, e.g. by setting a SharedPreferences flag to indicate
* that removal is in progress. If this methods fails, you can check this flag to retry at a later point.
* Only once this method succeeds, this flag should be cleared.
* <p>
* It's recommended to increase the max. DB size to ensure addition capacity is available for this method.
@christopheranderton
christopheranderton / update-outdated-brew-casks.sh
Last active February 4, 2024 17:29
Upgrade outdated brew casks. One liner, and the ”official” way to do it without using different hacks or scripts. However, it does not really replace some scripts out there, as in-app updates is not seen by Homebrew.
# Upgrade / Update outdated casks installed.
# --------------------------------------------------------------------------------
# Looks for outdated casks and installs the the latest version.
# User data (like application preferences) is intact.
# Updated one liner (thanks Henrik242)
# --------------------------------------------------------------------------------
brew upgrade $(brew outdated --cask --greedy --quiet)