Skip to content

Instantly share code, notes, and snippets.

@SandNerd
SandNerd / android_eventbus.md
Last active August 2, 2023 16:47
Android EventBus

Event Bus

(EventBus) - Android optimized event bus that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.

An EventBus is a great tool for decoupling components in your application. Over the next few posts I will describe the ways that I have been using it to make my code cleaner, easier to read, and easier to test. But first, this week I want to discuss why I use an EventBus in the first place. In particular, I will compare its use to some alternative techniques.

@SandNerd
SandNerd / containerise_list
Last active June 5, 2023 16:36
Ready list of tons of companies for use with Firefox's Containerise extension https://addons.mozilla.org/en-US/firefox/addon/containerise
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.ac/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.ae/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.at/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.be/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.bg/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.bh/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.ca/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.cm/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.cn/ , Yahoo
@^[^/]+//(?!mail|login|guce\.)(?:[^/]+\.)?yahoo\.co/ , Yahoo
@SandNerd
SandNerd / google_voice_texts.py
Created February 4, 2022 01:53
Google Voice Takeout Parser
# Python script to parse google voice takeout messages into csv
# command line arguments
from bs4 import BeautifulSoup
import pandas as pd
import os
import argparse
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()

YARD CHEATSHEET http://yardoc.org

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
# @since 0.6.0
@SandNerd
SandNerd / ruby_manipulation_tricks.md
Last active September 17, 2016 01:35
Ruby Gems Manipulation

Ruby Gems Manipulation

"hmm, so they didn't give you a decent api to make the changes you need.."

"Can't touch this"

Methods

Removing

@SandNerd
SandNerd / gist:10a1b2d3f025cbc18e2bfaa94908fe84
Created August 12, 2016 22:35 — forked from Jauny/gist:3876531
Understanding blocks, Procs and lambda!

#Understanding blocks, Procs and lambdas. I think blocks, Procs and lambdas are working in a really counter-intuitive way when you
first try to understand how they work, and most of the (amazing) resources one can find online
are too complicated to allow to understand how they work without frustration...

So here is my take on it; I'll try to make it as simple and concise as possible,
and will focus on how it is used, instead of how it works under the hood.

##Blocks A block is simply a piece of code that will (usually) execute something;

@SandNerd
SandNerd / state_machine.md
Created May 25, 2016 05:45
androidstate_machine.md

HierarchicalSM

A state machine which processes messages and can have states arranged hierarchically.

Usage

Construction

State